Abstract
Background:
Alzheimer's disease is the most common age-related dementia. Recent compelling evidence from previous retrospective electronic health record (EHRs) studies suggests that herpes simplex virus (HSV) infections may be a risk factor for developing dementia. However, no age and propensity score matched studies have been published in a United States general population cohort study to date.
Objective:
We aimed to identify whether HSV infection shows a significantly increased risk of the development of dementia in a sizable and heterogeneous cohort. We investigated whether herpes simplex virus type 1 (HSV1), herpes simplex virus type 2 (HSV2), or coinfections with both serotypes pose a greater risk of developing dementia across different biological sexes and racial groups.
Methods:
EHRs from patients with a history of HSV or specific serotypes (HSV1 or HSV2) infection were selected for analysis. These records were compared to a propensity-matched control group and analyzed for hazard and odds ratios through TriNetX.
Results:
There was a significant difference in dementia incidence in the HSV-infected group versus the control. Individuals with a history of HSV, HSV1, HSV2, and coinfection all showed a significant risk of developing dementia compared to controls. Males with HSV2 are at a higher risk of dementia outcome than females with HSV2.
Conclusions:
While consistent with previous reports, these findings are the first to establish a higher risk of developing dementia in patients who have any HSV diagnosis using a nationwide, population-based matched cohort study in the United States.
Introduction
The World Health Organization estimates that approximately 50 million individuals globally suffer from dementia, with nearly 10 million new cases annually. 1 The total number of dementia cases is projected to increase to 82 million by 2030, and 152 million by 2050.1,2 The economic impact of dementia in the U.S. is substantial, with costs expected to reach $360 billion in 2024, which includes health and long-term care expenses.3,4 By 2050, these costs are projected to nearly triple, reaching around $1 trillion annually. 5 Although medications are currently available to treat dementia, none offer a cure or delay disease progression entirely. 3 Therefore, there is a strong need to find an effective therapeutic target to halt or reverse the disease's clinical progression. Robust evidence linking both subtypes of the highly prevalent neurotropic herpes simplex virus (HSV) to the propagation of dementia-like neuropathology may offer new avenues for therapeutic intervention.6–15 HSV infections are highly prevalent, incurable, lifelong infections that can cause various central nervous system diseases. 16 It is essential to investigate the link between HSV infection and the development of dementia to uncover how HSV contributes to neurodegenerative diseases, which is crucial for both prevention and therapeutic development.
The highly infectious herpes simplex virus type 1 (HSV1) and herpes simplex virus type 2 (HSV2) share a 50% homologous genome (83% homology in protein-coding regions) and are among the nine identified herpesviruses that naturally infect humans and cause disease.17,18 It is estimated that 67% of adults have HSV1, while 22% have a HSV2 infection.18,19 HSV infection prevalence is greater in females versus males and is also known to increase linearly with age. 20 Highlighting the disproportionate effects of HSV from individual to individual, it is estimated that only one in five infected individuals suffer from frequent reactivation of HSV (often manifesting as painful sores). 21 This reactivation of the virus is thought to propagate the development of neurodegenerative pathology, as many preclinical studies have shown that the cycling of HSV promotes the aggregation of amyloid and pathological processing of tau.7–13 Both serotypes of HSV can latently infect and reactivate from the trigeminal ganglia or the lumbar-sacral ganglia, leading to clinical presentations of orolabial or genital herpes. 22 Coinfection can also occur when an individual is infected with both serotypes. 23
Retrospective analyses of electronic health records (EHRs) have revealed a significant association between HSV infections and an increased risk of developing dementia.6,24–29 EHRs provide a valuable means to retrospectively observe clinical outcomes, enhancing our understanding of disease interactions and helping identify trends. However, previous EHRs studies investigating the correlation between HSV infection and dementia have yielded inconsistent results. Most of these studies report strong correlations.6,24–29 However, some have found no link.30–32
Despite these discrepancies, robust preclinical evidence supports the role of HSV1 and HSV2 in triggering neuropathological changes associated with dementia.7–13,33 Numerous studies have demonstrated that antiherpetic medications can reduce the formation of amyloid-beta plaques and inhibit the toxic processing of tau while mitigating other common pathologies linked to dementia.25,26,28,34 Our findings corroborate studies establishing a connection between HSV infections and the development of dementia-like neuropathology.6–15
In this study, we examined whether a history of HSV infection—specifically HSV1, HSV2, or a co-infection with both serotypes—is associated with an increased risk of developing dementia. These findings represent the first nationwide, population-based matched cohort study in the United States utilizing the TriNetX network. We provide a comprehensive analysis by estimating propensity-matched cohorts’ risk, odds, and Cox hazard ratios balanced by dementia-associated risk factors. We compared patients with medical records indicating infection with a specific HSV serotype (HSV1 or HSV2), a co-infection of both serotypes and any history of HSV infection to propensity-matched controls. This approach offers deeper clinical insights into the potential risk these viruses pose for dementia development.
Methods
Data source
We conducted a retrospective, non-interventional cohort study using the TriNetX database. EHRs were obtained from the TriNetX Natural Language Processing (NLP) service, which utilizes advanced algorithms to acquire clinical information from discharge summaries, progress notes, and pathology reports from approximately 120 million patients. This dataset includes a wide range of information such as demographic details, diagnoses (recorded using ICD-10-CM codes), procedures (coded under ICD-10-PCS or CPT), medications (coded according to the Veterans Affairs National Formulary), laboratory tests (coded with LOINC), genomics data (coded using HGVS), and healthcare utilization information. The entire process of data collection, processing, and transmission was carried out in accordance with various Data Protection laws applicable to the contributing HCOs, including the EU Data Protection Law Regulation 2016/679, the General Data Protection Regulation, and the US Health Insurance Portability and Accountability Act (HIPAA). TriNetX EMEA and Global Collaborative Networks are distributed networks that utilize anonymized or pseudonymized/deidentified (as per HIPAA) data kept at the HCOs, with only aggregated results being sent back to the TriNetX platform. Personal data is not transferred from the HCOs. TriNetX is ISO 27001:2013 certified and maintains a robust IT security program that safeguards personal and healthcare data.
Study population and cohorts
We identified a base population of 33,236,890 patients currently aged 65 years or older as a primary target cohort to investigate cases of HSV infection and dementia (Figure 1). We split the population into two cohorts: (1) HSV cohort (n = 19,554)—any instance of a positive HSV1 or HSV2 pathogen test (2) Control cohort (n = 96,569)—no history of HSV infection (ICD-10-CM B00) or any instance of a positive HSV pathogen test but had at least two instances of either an inpatient acute visit or laboratory test (Figure 1). To identify positive or negative test results, we used LOINC codes for HSV1 (16952-4, 16291-7, 16130-7, 51916-5, 82190-0, 40466-5, 17850-9, 5846-1, 16953-2, 92870-5, 94581-6, 93439-8, 86539-4, 33291-6, 14084-8, 90452-4, 88128-4, 91859-9, 31848-5) and for HSV2 (45210-2, 31851-9, 91858-1, 44503-1, 90454-0, 32688-4, 14085-5, 86541-0, 93438-0, 16955-7, 44484-4, 94582-4, 16959-9, 92873-9, 5849-5, 16131-5, 43180-9). Cohorts were then distinguished based on the type of HSV infection: (3) HSV1 cohort (n = 9905)—those with a positive HSV1 test and whose most recent HSV2 test was negative, excluding individuals with a positive HSV2 test; (4) HSV2 cohort (n = 3273)—those with a positive HSV2 test and whose most recent HSV1 test was negative, excluding individuals with a positive HSV1 test; (5) Coinfection cohort (n = 3245)—those with both a positive HSV1 and HSV2 test. We further stratified the population based on sex and race (Table 1). Dementia was identified using the following ICD-10 codes: Vascular dementia (F01), dementia in other diseases classified elsewhere (F02), unspecified dementia (F03), and other degenerative diseases of the nervous system (G30-G32). Patients under 65 whose dementia diagnosis occurred before HSV infection or less than 1 year after infection were excluded. Frequently recurring HSV infections are often defined by their annual occurrence rate; we arbitrarily selected one year to allow for reactivation, as most molecular data indicate that HSV reactivation produces the molecular hallmarks of Alzheimer's disease. The cohorts’ baseline patient characteristics include the total number of patients, current age, index age, sex, ethnicity, race, and dementia risk factors (Table 2).

Cohort selection. Flowchart depicting patient cohort selection indicating the number of patients within each cohort stratification.
Stratification of sex and race across cohorts. This table presents the number of patients in cohorts stratified by sex and race.
Baseline characteristics of cohorts. This table presents the baseline characteristics of the five cohorts used for analysis.
Propensity score matching
Propensity score matching was performed on the TriNetX platform, which uses greedy nearest neighbor matching with a caliper of 0.1 pooled standard deviation. Cohorts were matched by age at positive HSV test, sex, race, ethnicity, and the following dementia risk factors: depression (F32), diabetes mellitus (E08-E13), heart disease (I25), obesity (E66), stroke (I63), hypertension (I10-I15), injuries to the head (S00-S09), and personal history of traumatic brain injury (Z87.820). 35 Sex-stratified cohorts were matched by age at index, race, ethnicity, and dementia risk factors. Race-stratified cohorts were matched by age at index, sex, and dementia risk factors. The baseline characteristics of all cohort comparisons, both before and after propensity score matching, are detailed in Supplemental Tables 1-16.
Statistical analysis
All analyses were performed online using the TriNetX platform, which utilized built-in analytical functions to investigate the association between dementia and HSV serotype. For assessing dementia as an outcome, the risk difference and odds ratio, including their values and confidence intervals, were calculated. Kaplan-Meier, including Cox Proportional hazard analyses, was used to evaluate the probability of developing dementia at least 1 year after the index event and thereafter (Figure 2). Independent t-tests were used to assess differences in continuous variables between cohorts. In contrast, chi-square tests were used to analyze categorical variables. The final data acquisition and statistical analysis was performed on 5/30/2024. Results were presented as risk differences (p < 0.05 was considered statistically significant), and a Cox hazard ratio with a 95% confidence interval.

Timeline of study design. The timeline shows that propensity score matching occurred any time before the index event. The outcome of dementia was measured any time after one year past the first HSV diagnosis. One year after HSV diagnosis was considered to allow for enough time for the reactivation of the virus to occur.
Results
HSV and dementia
To investigate the association between overall HSV infection and dementia, cohorts of patients with a history of any HSV infection, only HSV1, only HSV2, or a coinfection (both HSV1 and HSV2) were compared to a control cohort of patients who had no history of HSV. The baseline characteristics of the cohorts are represented in Table 2. The analysis showed that patients in the HSV cohort have a significantly increased risk of developing dementia, as indicated by a risk difference of 1.66% (95% CI: 1.33–1.99; p < 0.0001), an odds ratio of 2.15 (95% CI: 1.84–2.51), and a hazard ratio of 1.69 (95% CI: 1.44–1.97) (Table 3, Figures 3 and 4). Similar results were observed when we restricted our analysis to patients affected by HSV1 only (risk difference: 1.67%, 95% CI: 1.23–2.11, p < 0.0001; odds ratio: 2.16, 95% CI: 1.76–2.66; hazard ratio: 1.66, 95% CI: 1.34–2.06), by HSV2 only (risk difference: 1.78%, 95% CI: 1.01–2.54, p < 0.0001; odds ratio: 2.12, 95% CI: 1.52–2.95; hazard ratio: 1.76, 95% CI: 1.26–2.45), and in patients coinfected by HSV1 and HSV2 (risk difference: 2.38%, 95% CI: 1.63–3.12, p < 0.0001; odds ratio: 3.47, 95% CI: 2.30–5.23; hazard ratio: 2.44, 95% CI: 1.59–3.72) (Table 3, Figures 3 and 4).

Odds ratio for dementia diagnosis associated with HSV infection. The odds ratio for dementia diagnosis in patients with history of any HSV infection (2.149, 95% CI: 1.843–2.507), a history of specific serotype either HSV1 (2.16, 95% CI: 1.757–2.656), or HSV2 (2.119, 95% CI: 1.524–2.946) or a coinfection of both serotypes (3.468, 95% CI: 2.297–5.234). Error bars represent the 95% confidence intervals for each odds ratio.

Kaplan-Meier curves indicate a higher cumulative risk of dementia diagnosis associated with HSV serotype infections. Each panel represents a different analysis of dementia diagnosis risk following HSV infection compared to a propensity-matched control cohort with no HSV diagnosis. The solid lines represent estimated dementia risk and shaded areas indicate the 95% confidence intervals. (A) Shows the dementia diagnosis risk for a non-specific HSV infection diagnosis. (B) Illustrates the dementia risk for HSV1 diagnosis. (C) Depicts the dementia risk for HSV2 diagnosis. (D) Dementia risk for the coinfection diagnosis (combined HSV1 and HSV2).
Comparative risk metrics for HSV serotype infections versus control. Summary of the risk metrics for different HSV serotypes (nonspecific HSV, HSV-1, HSV-2, and coinfection) compared to control groups.
HSV and dementia based on biological sex
The risk of developing dementia in patients with either HSV1 or HSV2 did not significantly differ between males and females. The risk difference was 0.03% (95% CI: −0.51–0.56%; p = 0.92), with an odds ratio of 1.01 (95% CI: 0.84–1.21) and a hazard ratio of 1.11 (95%: 0.93–1.33). Similarly, no significant difference was seen in HSV1 patients (risk difference: −0.76%, 95% CI: −1.56–0.03, p = 0.06; odds ratio: 0.78, 95% CI: 0.6–1.01, hazard ratio 0.88, 95% CI: 0.68–1.14), or in patients coinfected with HSV1 and HSV2 (risk difference: 0.36%, 95% CI: −0.97–1.69, p = 0.59; odds ratio: 1.13, 95% CI: 0.73–1.75; hazard ratio: 1.30, 95% CI: 0.85–2.00). In contrast, males with HSV2 were found to be at a significantly higher risk than females (risk difference: 2.26%, 95% CI: 0.66–3.86, p = 0.01; odds ratio: 2.01, 95% CI: 1.22–3.32; hazard ratio: 2.06, 95% CI: 1.26–3.38).
HSV and dementia based on race
In patients with either HSV1 or HSV2, the risk of developing dementia did not significantly differ between White individuals and Black or African American individuals (risk difference: −0.51%, 95% CI: −1.59–0.58, p = 0.36; odds ratio: 0.85, 95% CI: 0.60–1.20; hazard ratio: 0.82, 95% CI: 0.58–1.15), or between Hispanic or Latino individuals compared to those of other racial groups (risk difference: 0.16%, 95% CI: −1.02–1.34, p = 0.79; odds ratio: 1.07, 95% CI: 0.64–1.81; hazard ratio: 0.97, 95% CI: 0.58–1.63). Similar trends were seen when comparing White individuals to Black or African American individuals with HSV1 only (risk difference: −0.07%, 95% CI: −2.26–2.12, p = 0.95; odds ratio: 0.98, 95% CI: 0.45–2.13; hazard ratio: 0.85, 95% CI: 0.39–1.84), HSV2 only (risk difference: −0.76%, 95% CI: −3.22–1.69, p = 0.54; odds ratio: 0.83, 95% CI: 0.45–1.52; hazard ratio: 0.87, 95% CI: 0.48–1.58), and coinfected patients (risk difference: 0.04%, 95% CI: −2.51–2.59, p = 0.98; odds ratio: 1.01, 95% CI: 0.56–1.84; hazard ratio: 0.93, 95% CI: 0.51–1.67). Additionally, no significant difference was seen between Hispanic or Latino individuals and other racial groups with HSV1 only (risk difference: 0.15%, 95% CI: −1.42–1.73, p = 0.85; odds ratio: 1.09, 95% CI: 0.46–2.58; hazard ratio: 1.87, 95% CI: 0.69–5.05), HSV2 only (risk difference: 0.20%, 95% CI: −5.72–6.11, p = 0.95; odds ratio: 1.03, 95% CI: 0.42–2.56; hazard ratio: 0.98, 95% CI: 0.24–3.94), or coinfection (risk difference: −0.69%, 95% CI: −3.80–2.42, p = 0.66; odds ratio: 0.83, 95% CI: 0.35–1.95; hazard ratio: 0.84, 95% CI: 0.36–1.94).
Discussion
HSV and dementia
This study was designed as a retrospective, non-interventional cohort study of patients to investigate the association between HSV and dementia. We found a significant association between all HSV infections and increased dementia risk. This correlation was significant, with increased odds and hazard ratios that underscore a meaningful clinical impact. The risk difference, odds ratio, and hazard ratio values presented for either nonspecific HSV infection, HSV1, HSV2, or coinfection are higher than those without HSV history (Table 3, Figures 3 and 4). These findings align with the infectious and neuroinflammatory hypothesis of dementia. 36 This hypothesis posits that infections can trigger or accelerate the neuropathological processes leading to cognitive decline and dementia. Inflammatory processes within the central nervous system, which viral infections like HSV could exacerbate, can increase clinical dementia risk.31,36,37
While previous studies have identified potential links between HSV and dementia, none have definitively established this association within a broad US population.24–29 Our study advances the understanding by leveraging a large, diverse U.S. cohort, offering more comprehensive epidemiological insights.
HSV and dementia based on biological sex
As compared to female patients, our analysis revealed a marked increase in dementia risk among male patients with HSV2 but not in other subgroups or in those with HSV1. This distinction could suggest sex-specific biological pathways affected by HSV2, potentially involving hormonal or immune response differences that might modify the disease's progression or severity. These findings urge a reevaluation of clinical approaches to managing HSV in different sexes, potentially advocating for more aggressive monitoring or therapeutic strategies in males diagnosed with HSV2.
HSV and dementia based on race
Contrary to expectations, we found no significant differences in dementia risk among different racial groups for patients with HSV. This lack of disparity might be influenced by factors such as equal access to healthcare within the study population or similar treatment regimens for HSV across groups. However, it also highlights the complexity of dementia's etiology, suggesting that while HSV contributes, its impact might be moderated by genetic, environmental, or socio-economic factors not fully captured in this study.
Methodological strengths and limitations
A major strength of our study is the use of unbiased, real-world evidence data collection of patient clinical records across active HCOs across the US. To our knowledge, no other studies have offered such a thorough analysis of the clinical data that studies the relationship between various HSV strains and dementia. Our methods included propensity score matching to enhance the reliability of our findings by minimizing confounding bias. Nevertheless, the study's retrospective nature introduces inherent limitations, such as potential misclassification of HSV status and dementia diagnoses, incomplete records, and loss of follow-up patients. This study also lacks a comparison to a viral infection unrelated to HSV.
Additionally, while we accounted for many potential confounders through propensity score matching, some factors required indirect consideration. For example, Vitamin D deficiency has been associated with both a higher prevalence of HSV and an increased risk of cognitive decline and dementia.38,39 While this study did not specifically propensity score match for individuals with Vitamin D deficiency, we addressed this potential confounder indirectly by accounting for obesity–a condition inversely related to Vitamin D deficiency–in our analysis. 40 As a result, we mitigated the influence of Vitamin D deficiency as a confounding variable in all but one of our cohort comparisons. Notably, after propensity score matching, a small but significant difference in obesity prevalence remained in the HSV2 cohort, whereas all other cohort comparisons were well-balanced (Supplemental Tables 1–4). Future studies should specifically explore the interaction between Vitamin D deficiency, HSV, and dementia outcomes. These limitations highlight important directions for future research. Studies specifically designed to explore the complex interactions between Vitamin D deficiency, HSV infection, and dementia outcomes would be particularly valuable.
Implications for future research
Our findings provide additional foundation for further investigations into the neuropathological mechanisms linking HSV with dementia, emphasizing the importance of longitudinal studies that can better establish causality. Exploring the differential impacts of HSV on dementia progression may also uncover new therapeutic targets, preventive measures, or insights into the broader development of dementia.
This study contributes to a growing body of evidence that underscores several critical avenues for future research on the link between infections and dementia. While our findings establish a clear association between HSV and dementia risk, recent research highlights a broader role of inflammation in dementia development. Various infections may contribute to dementia risk through general inflammatory pathways, 41 yet a significant gap in understanding exists regarding how pathogen-specific effects and generalized inflammation from diverse infections influence neurodegeneration. Future studies could address this gap by comparing dementia outcomes linked to pathogens that cause peripheral versus central nervous system infections. Leveraging large, diverse datasets derived from EHRs to explore the contributions of specific pathogens and overall infection burden could provide a clearer picture of these complex interactions.
Understanding how viral infections like HSV contribute to dementia risk and progression could transform our approach to dementia prevention and treatment. Mechanistic studies investigating the intersection of infectious diseases and neurodegeneration hold promise for uncovering innovative antiviral therapies and preventative strategies, offering a path toward reducing the global burden of dementia.
Conclusion
In conclusion, our study significantly contributes to the existing literature by demonstrating an increased risk of dementia associated with HSV infections in a large, diverse U.S. population. These results reinforce the importance of considering viral infections like HSV as significant factors in dementia risk assessments and highlight the need for targeted clinical strategies based on demographic characteristics such as sex. We must continue to refine our understanding of these associations through more mechanistically focused research.
Supplemental Material
sj-xlsx-1-alz-10.1177_13872877251317228 - Supplemental material for Increased risk of dementia associated with herpes simplex virus infections: Evidence from a retrospective cohort study using U.S. electronic health records
Supplemental material, sj-xlsx-1-alz-10.1177_13872877251317228 for Increased risk of dementia associated with herpes simplex virus infections: Evidence from a retrospective cohort study using U.S. electronic health records by Katherine Araya, Riley Watson, Kamil Khanipov, George Golovko and Giulio Taglialatela in Journal of Alzheimer's Disease
Footnotes
Acknowledgments
We would like to acknowledge Jenna L. Crosson, PhD for reviewing and editing this manuscript. The content is solely the responsibility of the authors and does not necessarily represent the official views of the NIH.
Author contributions
Katherine Araya (Conceptualization; Formal analysis; Investigation; Methodology; Project administration; Software; Visualization; Writing – original draft); Riley Watson (Formal analysis; Investigation; Methodology; Visualization; Writing – original draft); George Golovko (Conceptualization; Formal analysis; Supervision; Writing – review & editing); Kamil Khanipov (Formal analysis; Software; Visualization); Giulio Taglialatela (Conceptualization; Supervision; Writing – review & editing).
Funding
The authors disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This research was supported by the National Institute on Aging (T32-AG067952; 1R01AG069433; 1R01AG073133), the UTMB Institute for Translational Sciences, supported in part by a Clinical and Translational Science Award (UL1 TR001439) from the National Center for Advancing Translational Sciences at the National Institutes of Health (NIH) and the Mitchell Center for Neurodegenerative Diseases at The University of Texas Medical Branch.
Declaration of conflicting interests
Giulio Taglialatela, PhD, is an Editorial Board Member of this journal but was not involved in the peer-review process of this article, nor had access to any information regarding its peer-review.
The remaining authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Data availability
The TriNetX Federated Data Network (TriNetX Network) is a subscription-based clinical data platform of global, deidentified electronic medical records available for querying. Data in the TriNetX Network were initially sourced from various information systems that chronicle the patients’ passage through different healthcare settings. Network members include academic medical centers, integrated delivery networks, specialty hospitals, and large specialty physician practices. Additional information about the TriNetX Network can be found here: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6816049/. A subscription is required to access the data. Subscription requests can be made by contacting join@trinetx.com and logging into the network at
.
Supplemental material
Supplemental material for this article is available online.
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
