---
title: "How to Calculate Churn Rate from Stripe"
description: "Calculate churn rate from Stripe in TypeScript: customer, gross MRR, and net MRR churn from subscriptions and events, plus a CSV path."
canonical: https://datalighthouse.dev/guides/calculate-churn-rate-from-stripe
last-updated: 2026-11-16
---

# How to Calculate Churn Rate from Stripe
Calculate churn rate from Stripe in TypeScript: customer, gross MRR, and net MRR churn from subscriptions and events, plus a CSV path.
### 1. Choose the window and which churn rate you are reporting

Use a half-open window from periodStart to periodEnd. Customer churn divides customers who had a qualifying subscription at periodStart and none at periodEnd by the starting customer count. Gross MRR churn divides churned MRR plus contraction MRR by starting MRR. Net MRR churn subtracts expansion MRR from that numerator. Net revenue retention divides the starting customers' ending MRR by starting MRR. Leave new MRR and reactivation MRR out of those rates.

### 2. List subscriptions for each status you might count

Call subscriptions.list once per status with limit 100 and follow autoPagingToArray until the list ends. Request active, trialing, past_due, paused, unpaid, and canceled. The default list omits canceled subscriptions, so a churn report that skips status=canceled cannot see who left. status=all also returns incomplete and incomplete_expired subscriptions. Do not sum every row from that call.

### 3. List subscription events inside the 30-day retention window

Call events.list with the subscription event types, a created range, and limit 100, then follow auto-pagination. Stripe lists events going back up to 30 days. An updated event can include previous_attributes.items, the whole items array from before that change. A deleted event is sent when the subscription ends. Setting cancel_at_period_end sends updated, and the deleted event comes later.

### 4. Mark who was active at the start and at the end

A subscription is in the book at a timestamp when start_date is at or before that timestamp and ended_at is null or later. The default counts status active. A subscription still inside trial_end is out. past_due and paused are out unless you opt in. unpaid, incomplete, and incomplete_expired are out. cancel_at_period_end stays in the book until ended_at. pause_collection leaves status unchanged, so those subscriptions stay in the book.

### 5. Split churned, contraction, expansion, new, and reactivation MRR

Normalize each qualifying subscription to one month with the shared MRR function. Keep each currency in its own book. A starting customer with no subscription at the end contributes their starting MRR as churned MRR. A starting customer whose MRR fell contributes the decrease as contraction. An increase from a starting customer is expansion. MRR from someone absent at the start is new MRR, or reactivation MRR when an earlier subscription already had an ended_at at or before the window.

### 6. Compare the result with Billing analytics and a CSV export

Stripe Billing analytics can include past_due, can count a cancellation when it is scheduled, adds new subscribers to the subscriber-churn denominator, and can apply an FX adjustment. This function uses the starting base only, excludes past_due unless you opt in, and does not convert currencies. A subscriptions CSV is one snapshot. Normalize the starting export and the ending export with the Stripe MRR CSV calculator, then apply these formulas. That page does not upload the file and does not return a churn rate.

## FAQ
### How do you calculate churn rate from Stripe?

Stripe does not return a churn field. List subscriptions, including canceled ones, and subscription events. Count customers with a qualifying subscription at the start of the window and none at the end, and divide by the starting customers. For MRR churn, normalize each subscription to one month, then divide churned MRR plus contraction by starting MRR. Subtract expansion only when you are reporting net MRR churn.

### What is the difference between Stripe customer churn and MRR churn?

Customer churn counts logos. A customer with two subscriptions who cancels one is still a customer, so customer churn does not move and the lost dollars are contraction. Gross MRR churn divides canceled MRR plus contraction by starting MRR. Net MRR churn also subtracts expansion. Net revenue retention on this page is the starting book after those three movements, divided by starting MRR. New MRR is a separate line.

### Why does the Stripe Dashboard churn rate differ from my calculation?

Billing analytics is configurable. Its MRR includes active and past_due subscriptions and excludes legacy trials. Subscriber churn divides churned subscribers by the subscribers from 30 days ago plus new subscribers in the period. This page divides by the starting customers only and leaves past_due out unless you opt in. Charts use the account time zone, while prebuilt report dates use UTC. Multi-currency accounts can include an FX adjustment. This function does not convert currencies.

### Does cancel_at_period_end count as Stripe churn immediately?

Not in this function. Stripe keeps the subscription active until the period ends, then sends customer.subscription.deleted and sets ended_at. The subscription stays in the starting and ending book until that timestamp. Billing analytics can be configured to count the cancellation when it is scheduled instead. A refund issued at cancellation is cash. This function does not read Refund or Charge objects.

### How do trials, paused subscriptions, and annual plans affect Stripe churn?

A subscription with trial_end still in the future is outside the default book, so a trial that cancels before it converts is not customer churn. status paused is outside the default book. pause_collection does not change status, and invoices still generate, so those subscriptions stay. A yearly price is divided by 12, and by interval_count, before it enters MRR. Canceling a $120 yearly plan removes $10 of MRR, which is the same divisor Stripe uses in its Billing analytics example.

### Can I calculate Stripe churn without code?

Export the subscriptions CSV at the start of the period and again at the end. The Stripe MRR CSV calculator at https://datalighthouse.dev/tools/stripe-mrr-csv-calculator normalizes one file in the browser and does not upload it. It returns MRR per currency, not a churn rate. Compare the two totals with the formulas on this page. Data Lighthouse is a self-hosted Next.js template. The overview does not compute churn. The license is $59 once. The buyer page is https://datalighthouse.dev/saas-metrics-dashboard-template and the sample dashboard is https://datalighthouse.dev/demo. The demo uses sample data and does not call Stripe.


## Sources
- [Stripe API: list subscriptions](https://docs.stripe.com/api/subscriptions/list)
- [Stripe API: Subscription object](https://docs.stripe.com/api/subscriptions/object)
- [Stripe API: list events](https://docs.stripe.com/api/events/list)
- [Stripe API: event types](https://docs.stripe.com/api/events/types)
- [Stripe: using webhooks with subscriptions](https://docs.stripe.com/billing/subscriptions/webhooks)
- [Stripe: how subscriptions work](https://docs.stripe.com/billing/subscriptions/overview)
- [Stripe: cancel subscriptions](https://docs.stripe.com/billing/subscriptions/cancel)
- [Stripe: Billing analytics](https://docs.stripe.com/billing/subscriptions/analytics)
- [Stripe: retention performance](https://docs.stripe.com/billing/retention/performance)
- [Stripe API: pagination](https://docs.stripe.com/api/pagination)
- [Wikipedia: churn rate](https://en.wikipedia.org/wiki/Churn_rate)
