Kaplan–Meier curve generator
Make a publication-style Kaplan–Meier plot in seconds. Paste your data below and you get survival curves with censor ticks, a numbers-at-risk table, the median per arm, the log-rank p-value, the Cox hazard ratio with 95% CI, and RMST. Download as SVG or PNG. Everything runs in your browser, so the data never leaves your computer.
Paste one row per patient as arm,time,event (event: 1 = event, 0 = censored). You can paste from Excel, R or SAS output, or load the example.
Data format
One row per patient, three columns: the group name, the follow-up time, and whether the event happened (1) or the patient was censored (0). Time can be in any unit, as long as it is the same unit throughout. A header row is optional.
arm,time,event Control,2.3,1 Control,18.0,0 Drug,6.4,1 Drug,24.0,0
What the generator computes
- Kaplan–Meier estimate S(t) = ∏ (1 − di/ni) over event times, drawn as a step function with censored patients marked as ticks.
- Median survival: the first time the curve reaches 50%, or "not reached" if it never does.
- Numbers at risk at each axis tick: patients still being followed and event-free.
- Log-rank p and hazard ratio (second group vs the first) from a Cox model with Breslow ties.
- RMST (restricted mean survival time) up to τ; see the RMST calculator for confidence intervals.
Only have a published figure?
If you have the curve but not the data, reconstruct the patient-level data from the figure, then paste the downloaded CSV here to re-plot, restyle or combine it.
Kaplan–Meier curves in other software
- R:
survfit(Surv(time, event) ~ arm)withsurvminer::ggsurvplot(fit, risk.table = TRUE). - Python:
lifelines.KaplanMeierFitterandadd_at_risk_counts. - Stata:
stset time, failure(event), thensts graph, by(arm) risktable. - SAS:
PROC LIFETEST plots=survival(atrisk). - GraphPad Prism: a survival table, which creates the KM graph automatically.
- Excel: no built-in KM function. Sort by time, compute (1 − d/n) at each event time, take the cumulative product, and plot a step chart. The generator above is quicker.
FAQ
How do I create a Kaplan-Meier curve online for free?
Paste one row per patient (group, time, event) into the generator on this page and click Draw. It produces the curve, numbers at risk, medians, log-rank p, hazard ratio and RMST, and lets you download SVG or PNG.
Is my data uploaded anywhere?
No. The Kaplan–Meier generator runs entirely in your browser.
Can I make a Kaplan-Meier curve in Excel?
Not directly. You can compute the product-limit estimate by hand in a spreadsheet and plot a step chart, but a dedicated tool (or R/Python/Prism) is faster and less error-prone.
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