How the Longtime Calculator works
The longevity calculator turns your profile inputs into a population-level estimate of life expectancy, biological age, healthspan, and relative mortality risk. It is designed for exploration and education, not diagnosis or medical advice.
Overview
Every estimate follows the same four steps:
- Choose a peer baseline from your age, sex, and country: a model life table for average-risk people in that group.
- Assign a hazard ratio (HR) to each input. An HR of 1.0 means “similar mortality risk to peers”; below 1 is protective, above 1 is elevated.
- Combine HRs into one overall risk multiplier for your profile, with separate handling for nutrition vs. other lifestyle factors.
- Apply that multiplier to the baseline mortality curve to estimate remaining years, then derive biological age, healthspan, and peer comparisons.
Step 1: Baseline peer group
We build country- and sex-specific annual mortality curves calibrated to national life-table remaining years around age 40. Each curve blends three components by age:
- Early-life mortality (infant and childhood)
- Accident mortality (highest roughly ages 15 to 35)
- Exponential senescence at older ages
Supported countries include Australia, Canada, Germany, Spain, France, Hong Kong, Israel, Italy, Japan, New Zealand, Portugal, Singapore, Taiwan, the United Kingdom, and the United States.
From your current age, we sum expected remaining years of life at average peer risk (multiplier = 1.0). That baseline, plus your age, is the reference for “vs peers” on the results panel.
Step 2: Hazard ratios by input
Each slider, toggle, or optional lab value maps to a conservative hazard ratio drawn from epidemiological literature. Where studies overlap (for example sleep duration and sleep consistency, or exercise minutes and daily steps), we use modest HRs on purpose.
Body
- BMI (from height and weight): tiered HRs from underweight through obesity III, based on the Global BMI Mortality Collaboration.
- Blood pressure, blood sugar (HbA1c), LDL cholesterol: optional tiered HRs applied only when you enter a value. Blank fields are skipped entirely.
Lifestyle
- Sleep hours: U-shaped association; roughly 6 to 8 hours/night is lowest risk.
- Sleep consistency: consistent, variable, or irregular schedule tiers.
- Exercise: minutes per week, with strongest benefit above ~150 min/week.
- Daily steps: separate tier from structured exercise; benefit increases toward ~10k+ steps.
- Smoking: never, former, or current; pack-years adjust former and current tiers. Pack-years are ignored when status is “never.”
- Alcohol: drinks per week, with lowest risk at light intake and rising risk at heavy intake.
Environment & mindset
- Air quality: good, moderate, or poor (proxy for long-term PM₂.₅ exposure).
- Financial security: comfortable, manageable, or insecure.
- Social connection: UI maps to a 1 to 5 scale (low / moderate / good).
- Stress: UI maps to a 1 to 5 scale (low / moderate / high chronic stress).
Nutrition
Twelve food groups are modeled with piecewise-linear dose-response curves from Schwingshackl et al., 2017. For each group, grams per day (millilitres for sugary drinks) are interpolated between published anchor points to yield a relative risk for that food alone:
- Whole grains (g/day)
- Vegetables (g/day)
- Fruit (g/day)
- Nuts (g/day)
- Legumes (g/day)
- Fish (g/day)
- Red meat (g/day)
- Processed meat (g/day)
- Sugary drinks (ml/day)
- Eggs (g/day)
- Dairy (g/day)
- Refined grains (g/day)
Individual food HRs are capped between 0.70× and 1.60× before aggregation. Diet presets on the calculator are illustrative daily patterns, not clinical meal plans, that set all twelve sliders at once.
Step 3: Combining factors
Naively multiplying twenty-plus hazard ratios would collapse almost every profile to an unrealistic “best case.” Instead we combine in two layers:
Nutrition layer
nutritionRisk = exp( mean(ln foodHRs) × 1.35 )
The geometric mean of the twelve food HRs is amplified slightly (× 1.35 on the log scale) so diet changes move the headline estimate without double-counting every food as fully independent.
Lifestyle layer
lifestyleRisk = exp( sum(ln otherHRs) × 0.7 )
BMI, sleep, exercise, steps, smoking, alcohol, environment, mindset, and optional biometrics are dampened (× 0.7 on the log scale) because several pairs partially overlap in real epidemiology.
Overall risk multiplier
risk = clamp( nutritionRisk × lifestyleRisk , 0.58 , 2.4 )
The final multiplier is bounded so estimates stay plausible. Values below 1.0 mean lower mortality risk than peers; above 1.0 mean higher risk.
Step 4: Life expectancy
Starting at your current age, we walk the country/sex mortality table year by year. At each age a, the annual death probability is adjusted by your risk multiplier:
qadj(a) = 1 − (1 − qbaseline(a))risk
We accumulate survival-weighted years until the table ends. Adding that to your age gives estimated life expectancy. The “vs peers” delta is the difference from the same calculation at risk = 1.0.
Biological age
Biological age answers: “How old would an average-risk peer need to be to have the same remaining life expectancy as me?” We binary-search ages on the baseline (risk = 1.0) curve until remaining years match your profile’s remaining years at your actual risk multiplier.
If your combined risk is lower than peers, biological age falls below your chronological age, and vice versa. Because this is a curve lookup, small input changes may move biological age in roughly one-year steps.
Healthspan
Healthspan is a simplified “years in relatively good health” estimate, not a clinical disability measure. We subtract a morbidity tail from estimated life expectancy:
healthspan ≈ lifeExpectancy − 9 × risk0.25
Higher overall risk lengthens the implied morbidity window. The result is clamped so it never falls below a few years after your current age or above your total life expectancy.
Mortality risk dial & peer rank
- Mortality risk (× vs peers): your combined risk multiplier, shown on the gauge. 1.0× is “like peers”; lower is better.
- Peer rank: derived from a log-normal distribution of HRs centered at 1.0. It approximates what share of peers with similar demographics you might outlive given your multiplier, for example “Top 25%” or “Bottom 10%.”
Top protectors & top risks
For each factor, we recompute life expectancy with that single factor removed (using the same aggregation rules as the headline estimate) and report the year difference. Factors are ranked by absolute impact; the five lowest HRs appear under protectors and the five highest under risks.
The nutrition breakdown chart shows each food group’s standalone relative risk from the dose-response curves, useful for spotting which foods drive diet risk, independent of the combined nutrition layer above.
What we store in your browser
Profile inputs are saved in session storage so refreshes keep your settings during the same browser session. Nothing is sent to a Longtime server for calculation; all math runs locally in your browser.
Important limitations
- Population averages, not personalized medicine. Your genetics, medical history, and care access matter.
- Factors are partly correlated in real life; dampening reduces but does not remove overlap.
- Optional labs can overlap with BMI, diet, and exercise signals already in the model.
- Country baselines are models fitted to life-table data, not year-by-year official tables.
- Diet presets and sliders describe typical intake patterns, not exact meals or supplement stacks.
- Clamps and rounding prevent extreme outputs but also cap how much any one change can move the estimate.
References
- Schwingshackl L, et al. Food groups and mortality. Am J Clin Nutr. 2017. doi:10.3945/ajcn.117.153148
- Global BMI Mortality Collaboration. Body-mass index and all-cause mortality. Lancet. 2016. doi:10.1016/S0140-6736(16)30175-1
- Cappuccio FP, et al. Sleep duration and all-cause mortality. Sleep. 2010. doi:10.5665/sleep.566
- Huang T, et al. Sleep regularity and mortality. Sleep. 2023. doi:10.1093/sleep/zsad066
- Arem H, et al. Leisure-time physical activity and mortality. JAMA Intern Med. 2015. doi:10.1001/jamainternmed.2015.0533
- Paluch AE, et al. Daily steps and mortality. JAMA Netw Open. 2021. doi:10.1001/jamanetworkopen.2021.24561
- Jha P, et al. Smoking and mortality. N Engl J Med. 2013. doi:10.1056/NEJMsa1211128
- GBD 2016 Alcohol Collaborators. Alcohol use and mortality. Lancet. 2018. doi:10.1016/S0140-6736(18)31310-2
- Pope CA, et al. Fine particulate air pollution and mortality. Lancet Planetary Health. 2020. doi:10.1016/S0140-6736(20)31349-7
- Stringhini S, et al. Socioeconomic status and mortality. Lancet. 2017. doi:10.1016/S0140-6736(17)32380-8
- Holt-Lunstad J, et al. Social relationships and mortality. PLOS Med. 2010. doi:10.1371/journal.pmed.1000316
- Kivimäki M, Steptoe A. Stress and cardiovascular disease. Nat Rev Cardiol. 2018. doi:10.1038/s41569-017-0009-1
- Ettehad D, et al. Blood pressure lowering and mortality. Lancet. 2016. doi:10.1016/S0140-6736(15)01225-8
- Emerging Risk Factors Collaboration. Diabetes and mortality. JAMA. 2010. doi:10.1001/jama.2010.1362
- Vallejo-Vaz AJ, et al. LDL cholesterol and mortality. Eur Heart J. 2017. doi:10.1093/eurheartj/ehx165