Home / Tools

Calculate a hazard ratio from a published Kaplan–Meier curve

Updated 2026-09-25 · TrialCurve methods team

Best method: reconstruct pseudo-IPD from the KM curve and its numbers-at-risk table (Guyot 2012), then fit a Cox model. This gives a hazard ratio with a 95% CI that typically lands within a few percent of the published value. If you only have summary statistics, the Tierney et al. (2007) methods estimate the log HR and its variance from p-values, event counts or confidence intervals.

From a figure

From patient-level or reconstructed data

Have reconstructed or real IPD already? Paste CSV rows as arm,time,event (event 1 = event, 0 = censored).

Methods compared

MethodNeedsAccuracy
Cox model on reconstructed IPD (Guyot)KM curve + at-risk tableBest; HR typically within a few percent
Tierney / Parmar indirect estimatesReported p-value and events, CI, or O−E and VGood when the needed statistics are reported
Parmar's curve-reading methodSurvival read at intervals + censoring assumptionsModerate; sensitive to assumptions
Median ratio shortcut (HR ≈ mediancontrol/mediantreatment)Two mediansRough; only under exponential survival

Check proportional hazards

A single HR summarises the curves well only if the hazards are roughly proportional. With reconstructed IPD you can inspect log(−log S) plots or Schoenfeld residuals. When curves cross or separate late, as often happens with immunotherapy, report RMST differences or time-varying HRs as well. Try the RMST calculator.

FAQ

Can I calculate a hazard ratio from medians alone?

Only approximately, and only if survival is roughly exponential in both arms: HR ≈ median(control) / median(treatment). Prefer reconstructed IPD or the Tierney methods.

Which arm is the reference?

By convention, the control arm. The calculator here compares the second arm in your data against the first, and the API lets you name the reference arm.

Reconstruct IPD from your own figure. Upload a Kaplan–Meier plot and get curves, numbers at risk, pseudo-IPD, hazard ratios and a validation pack. Three figures a month are free.

Try the live demo Browse trial data API docs