Kaplan-Meier Curve Generator

Figran

Create a Kaplan-Meier survival curve with number at risk from patient data or a survival table.

  • From patient data or a survival table
  • Log-rank p and hazard ratio
  • Free SVG and 300 DPI PNG

Survival curve editor

Data
Events: 0 · Censored: 0
Curves
Statistics
Axes
00.20.40.60.8100.20.40.60.81Time (Days)Survival probabilityNumber at riskEnter data to draw a curve

Kaplan-Meier curve examples

Two-arm trial

survival::aml · Miller 1997

Survival by sex

survival::lung · Loprinzi 1994

Four groups

survival::veteran · Kalbfleisch & Prentice

Single group with median

survival::lung · Loprinzi 1994

Cumulative incidence

survival::gbsg · Schumacher 1994

Small randomized trial

survival::ovarian · Edmonson 1979

Mouse survival study

Illustrative data

From a survival table

Illustrative data

How to make a Kaplan-Meier curve

  1. Paste your data

    Paste time, event, and an optional group.

  2. Confirm events

    Check the event and censor counts.

  3. Style the curve

    Choose confidence intervals and censor marks.

  4. Download

    Save your figure as PNG or SVG.

How to read a Kaplan-Meier curve

  1. Steps

    A drop represents an event.

  2. Censor marks

    Marks indicate observations censored at that time.

  3. Confidence band

    The band shows uncertainty in the estimate.

  4. Median survival

    The median is where survival reaches one half.

  5. Number at risk

    The table shows people still under observation.

How the Kaplan-Meier estimate works

The Kaplan-Meier estimate is the product S(t) = ∏(1 − dᵢ/nᵢ), where dᵢ events occur among nᵢ people at risk. At a shared time, events are counted before censoring. Greenwood’s formula estimates variance; the default confidence interval uses the log method.

The log-rank test compares groups across follow-up. The univariable Cox model estimates hazard ratios relative to the first group. In the presence of competing risks, 1 − KM is not a cumulative incidence function.

Sources: Kaplan and Meier (1958); Greenwood (1926); Morris et al., KMunicate (2019); Mantel (1966); Peto and Peto (1972); Brookmeyer and Crowley (1982); Efron (1977).

Frequently asked questions

What data do I need?

For patient data, use long format such as time,event,group followed by 5,1,Treatment; omit group for one group. Prism-style wide tables use time and one column per group, with 1 for an event and 0 for censoring. You can also supply a table such as time,survival,lower,upper followed by 5,0.8,0.7,0.9.

What does censored mean?

A censored observation is one for which the event was not observed during follow-up. A tick marks its time on the curve.

What is the log-rank test?

The log-rank test compares the survival experience of groups over follow-up. When curves cross, a single overall test may mask differences that change direction over time.

What is number at risk?

It is the number of people still under observation and event-free immediately before each time.

How is median survival calculated?

The median is the first time estimated survival reaches or falls below 0.5; a plateau exactly at 0.5 follows the R midpoint rule. If 0.5 is not reached, it is shown as NR.

Is the hazard ratio adjusted?

No. It comes from a univariable Cox model, with the first group as reference. The proportional hazards assumption matters; use Annotation for an adjusted result.

Do the results match R, SPSS or Prism?

Checked against R survival 3.8.12. Log, log-log and plain confidence intervals use different transformations and can give different limits in R, SPSS or Prism. Prism ignores observations at time zero.

Is patient data uploaded?

Data stays in your browser. A draft survives refresh in this tab and is cleared when the tab closes. Remove identifying information before publication.

Make your Kaplan-Meier curve

Turn survival data into a figure ready to share.