Skip to content

Kaplan–Meier Survival Calculator

Paste each subject's follow-up time and whether the event happened or the observation was censored, and get the Kaplan–Meier survival curve, a life table with Greenwood standard errors and confidence intervals, median survival with its interval, a number-at-risk table, and — when you add a group column — the log-rank test. Results follow R's survival package. Download the curve as SVG or PNG. Free, no sign-up; nothing leaves your browser.

Paste two or three columns from a spreadsheet, or separate values with tabs, commas or spaces. Status holds two labels, such as 1 and 0 or Dead and Alive; say below which one means the event happened. Add a third column to compare groups. A header row is optional.

Times separated by commas, for example 12, 24, 60.

Paste follow-up times with an event indicator to draw the Kaplan–Meier curve.

How to Use the Kaplan–Meier Calculator

  1. 1. Paste the data. One subject per row: time to the event or to the end of follow-up, then a status column with two labels (1/0, Dead/Alive, Relapse/None), then — if you want to compare groups — a group name. Copy from a spreadsheet or type with tabs, commas or spaces.
  2. 2. Say which status is the event. The calculator guesses (1, yes, dead, event…), and the other label is treated as censored. Change it if the guess is wrong.
  3. 3. Choose the interval and options. Log-log intervals stay within 0 to 1; log and plain intervals are there to match other software. Enter times such as 12, 24, 60 to read survival off at those points.
  4. 4. Read the results. The curve, the median and its interval, the number at risk, the survival table and, for two or more groups, the log-rank test appear below. Download the plot or the table.

What the Kaplan–Meier Estimator Does

In survival data some subjects have not had the event when observation ends — they moved away, the study closed, they were lost to follow-up. Their times are censored: all we know is that the event had not happened by then. The Kaplan–Meier (1958) estimator uses them correctly. At each time an event occurs, it multiplies the running survival probability by the share of at-risk subjects who survive that time: S(t) = Π (1 − dᵢ / nᵢ), where dᵢ is the number of events and nᵢ the number at risk (still under observation) at time tᵢ. A censored subject counts in nᵢ until their censoring time and then drops out, and the curve steps down only at events.

Greenwood's formula gives the uncertainty: Var[ln S(t)] = Σ dᵢ / (nᵢ (nᵢ − dᵢ)). The log-log interval, S(t) raised to exp(±1.96 × SE / |ln S|), cannot leave 0 to 1; the log interval S × exp(±1.96 × SE) is R's default; the plain interval S ± 1.96 × SE is clamped to [0, 1]. The median survival is the first time the curve reaches 0.5 or below, and its limits are the first times the interval curves do. If a curve never gets that low, the median is "not reached".

Comparing Groups with the Log-Rank Test

At every distinct event time the log-rank test asks how many deaths each group would be expected to have if all groups shared one curve, given who is at risk. Summing expected minus observed over all times gives a χ² statistic on k − 1 degrees of freedom for k groups. It tests the whole curves, not a single time point, and has the most power when the groups' hazards stay in a constant ratio (proportional hazards); curves that cross can hide a real difference. The test also assumes censoring is unrelated to the outlook — that someone censored at time t is as likely to have the event later as anyone else still at risk.

Worked Example: Maintenance Chemotherapy in Leukemia

Load example fills in the classic AML trial (Embury et al., 1977; the aml data in R's survival package): 23 patients, time in weeks to relapse, with or without maintenance chemotherapy.

GroupNRelapsesMedian (weeks)95% CI of median (log-log)
Maintained1173113 – not reached
Nonmaintained1211235 – 33

The maintained group's survival is 0.716 at 20 weeks (95% CI 0.350 to 0.899) against 0.583 for the nonmaintained group. The log-rank test gives χ² = 3.40 on 1 degree of freedom, p = .065. The maintained group had 7 relapses where 10.69 were expected (O/E = 0.65), the other group 11 where 7.31 were expected (O/E = 1.50). With 23 patients, that is suggestive but not conclusive evidence at the 5% level. Choosing the log interval instead gives the median interval 18 to not reached for the maintained group — the same data, a different transformation.

  • Treating censored times as events, or dropping them. Both bias the curve: counting them as deaths understates survival, and dropping them wastes information.
  • Reading the tail too literally. The right-hand end of a curve rests on a few subjects; look at the number-at-risk table before quoting survival at late times.
  • Comparing medians by whether their intervals overlap. Use the log-rank test for the comparison.
  • Ignoring other explanations. A Kaplan–Meier comparison does not adjust for age, stage or other differences between groups; a regression model for survival data does.

Frequently Asked Questions

What does censored mean in survival analysis?
A censored observation is a subject whose event had not happened by the last time they were observed — because the study ended, they withdrew, or they were lost to follow-up. The Kaplan–Meier method keeps them in the risk set until their censoring time, so they contribute information without being counted as events.
How do I read a Kaplan–Meier curve?
The y-axis is the estimated probability of surviving (not yet having the event) beyond each time on the x-axis. The curve is a staircase that steps down at each event; small tick marks show censored subjects. Where the curve crosses 0.5 is the median survival. The shaded band is the confidence interval.
What does "median not reached" mean?
The curve never fell to 0.5 during follow-up, so more than half the subjects were still event-free at the end — or the confidence band stays above 0.5, so one limit of the median cannot be estimated. It is a legitimate result, not an error; report survival at a fixed time instead.
Which confidence interval should I choose?
The log-log interval is a good default because it always stays between 0 and 1 and behaves well in the tails. The log interval is R's survfit default, and the plain interval is what many older textbooks show. If you are comparing with other software, choose the same setting.
What does the log-rank test assume?
It assumes censoring is non-informative and, for good power, that the hazard ratio between groups is roughly constant over time. If the curves cross, the test can miss a difference; consider a time-specific comparison or a weighted test.
Can I compare more than two groups?
Yes. Add a group column with up to six groups and the log-rank test is calculated across all of them, with χ² on k − 1 degrees of freedom. A significant result says the groups differ somewhere, not which ones; compare specific pairs afterwards with a correction for multiple testing.

Related Tools

More in Statistics Calculators

See all Statistics Calculators