A cohort retention analysis groups customers by when they started (the cohort), then shows what share of each group is still active one month, two months, three months later. The result is a triangle-shaped table: one row per cohort, one column per month since signup, each cell a percentage of that cohort's starting size.
To read it, compare down a column (is month-1 retention improving for newer cohorts?) and across a row (where does a cohort stop losing people?).
How to Build the Table in Four Steps
- Define the cohort. Usually the month of first purchase or signup. One row per cohort.
- Define "active." A purchase, a login, or a paid subscription in that month. Pick one definition and keep it, because every cell depends on it.
- Index time from each customer's own start. Month 0 is the cohort month; month 1 is the next, and so on. This is what lines cohorts up so they can be compared.
- Divide by cohort size. Cell = customers active in month k / customers in the cohort. Month 0 is 100% by construction.
A Worked Example
An illustrative table for four monthly signup cohorts. Cells are the percentage of the cohort that was active that many months after signing up. Blank cells are months that have not happened yet, which is why the table is a triangle.
| Cohort | Size | Month 0 | Month 1 | Month 2 | Month 3 | Month 4 |
|---|---|---|---|---|---|---|
| Jan | 400 | 100% | 41% | 33% | 29% | 27% |
| Feb | 450 | 100% | 44% | 36% | 32% | |
| Mar | 380 | 100% | 47% | 39% | ||
| Apr | 420 | 100% | 50% |
How to Read It
| Read along... | What you learn | In the example |
|---|---|---|
| A column (down) | Whether newer cohorts retain better at the same age | Month-1 retention climbs 41%, 44%, 47%, 50%: each newer cohort holds more people. Something changed for the better, such as onboarding. |
| A row (across) | The shape of one cohort's decay and where it flattens | January loses most people in month 1, then the drops shrink (41 to 33 to 29 to 27). The curve is flattening. |
| The diagonal | What happened in a calendar month across all cohorts | A dip on one diagonal in every cohort points to an outside event (an outage, a price change), not a cohort effect. |
The usual reading error is to compare the percentages of cohorts at different ages. Compare like with like: month 2 of January against month 2 of February, never month 4 of January against month 1 of April.
Building It in Python
import pandas as pd
# orders.csv: customer_id, order_date
o = pd.read_csv("orders.csv", parse_dates=["order_date"])
o["month"] = o.order_date.dt.to_period("M")
# cohort = month of first order; age = whole months since then
o["cohort"] = o.groupby("customer_id")["month"].transform("min")
o["age"] = (o.month - o.cohort).apply(lambda d: d.n)
active = (o.groupby(["cohort", "age"])["customer_id"]
.nunique().unstack(fill_value=0))
retention = active.div(active[0], axis=0) # divide by cohort size (age 0)
print((retention * 100).round(0))
Use unstack without filling future months: later cells that have not happened yet should stay empty rather than show as zero retention.
Common Mistakes
- Treating "not yet happened" as zero. The empty lower-right triangle is missing data, not lost customers.
- Cohorts too small to read. A cohort of 30 people moves several points on a single customer. Widen the cohort (quarterly) or show counts alongside percentages.
- Averaging retention across cohorts of different ages. Weight by cohort size and only average cells of the same age.
- Using revenue and customers interchangeably. Customer retention can fall while revenue retention rises if the survivors spend more. Build both when it matters.
To turn a retention curve into a single churn figure, see the churn rate formula. For the wider method, including segment cohorts, see cohort analysis.
Frequently Asked Questions
How do you calculate cohort retention?
Assign each customer to the cohort of their first purchase or signup month. For each cohort and each month since signup, divide the number of customers who were active in that month by the number of customers in the cohort.
How do you interpret a cohort analysis?
Read down a column to see whether newer cohorts retain better at the same age, and across a row to see how one cohort decays and where it flattens. A change that shows up in every cohort in the same calendar month points to an outside event.
What is a good cohort size?
Large enough that one customer does not move a cell by a visible amount. As a rough guide, cohorts of a few hundred customers give readable percentages; with small cohorts, group by quarter instead of month or display counts next to the percentages.
What is the difference between cohort retention and churn rate?
Churn rate is one number for a period: customers lost divided by customers at the start. A cohort retention table shows the whole curve for each signup group, which is how you see whether churn is concentrated early in a customer's life.
Why does the cohort table look like a triangle?
Newer cohorts have not had as many months to age, so their later columns do not exist yet. Those cells are missing data, not zero retention.