Churn rate is the percentage of your paying customers who cancel their subscriptions in a given period. For subscription businesses using Stripe, churn is your most important metric—it directly determines whether you're growing or shrinking. Understanding what drives churn in your Stripe account is the first step to reducing it.
Understanding Churn Rate in Stripe
Churn rate tells you what fraction of your subscription customers are leaving each month. In Stripe, this is tracked at the subscription level.
Define churn for your business model
Churn rate = (Subscriptions canceled in period / Active subscriptions at start of period) × 100. If you start March with 1,000 active subscriptions in Stripe and 50 cancel by month-end, your churn is 5%. For SaaS, a healthy churn rate is typically 2–5% monthly (24–60% annually). Stripe tracks every subscription state change via events, making this calculation straightforward.
// Example: Monthly churn calculation
const startDate = new Date('2024-03-01');
const endDate = new Date('2024-03-31');
// Calculate from Stripe event data
const canceledCount = 50; // subscription.deleted events
const startingActive = 1000; // active subscriptions on March 1
const churnRate = (canceledCount / startingActive) * 100;
console.log(`March churn: ${churnRate}%`); // Output: 5%Recognize why Stripe customers care about churn
Stripe subscription businesses live or die by churn. A 5% monthly churn means you lose half your customers in a year. Tracking churn accurately in Stripe helps you spot cancellation trends, identify at-risk segments, and measure the impact of retention efforts.
Calculating Churn Rate from Stripe Data
Stripe tracks subscription lifecycle through webhooks and the Subscriptions API. You can use this data to calculate precise churn metrics.
Fetch active subscriptions from Stripe
Use the Stripe Node SDK to list all active subscriptions at a specific date. Filter by status: 'active' to get your baseline subscriber count for the period.
const stripe = require('stripe')('sk_test_...');
// Get active subscriptions as of March 1
const subscriptions = await stripe.subscriptions.list({
status: 'active',
created: { gte: Math.floor(new Date('2024-03-01') / 1000) },
limit: 100,
});
const activeCount = subscriptions.data.length;
console.log(`Active subscriptions: ${activeCount}`);Count subscription cancellations via webhooks
Stripe fires a customer.subscription.deleted event each time a subscription is canceled. Listen to these events in your webhook handler and log them. Count all deletions within your period (e.g., March 1–31) to get your cancellation total.
Set up webhook listeners to track cancellation events
Configure a webhook endpoint in your Stripe Dashboard > Developers > Webhooks to receive customer.subscription.deleted events. Use the event data to log cancellations to your database for later analysis.
const express = require('express');
const stripe = require('stripe')('sk_test_...');
const app = express();
app.post('/webhooks/stripe', express.raw({type: 'application/json'}), (req, res) => {
const sig = req.headers['stripe-signature'];
let event;
try {
event = stripe.webhooks.constructEvent(req.body, sig, 'whsec_test_...');
} catch (err) {
return res.status(400).send(`Webhook Error: ${err.message}`);
}
if (event.type === 'customer.subscription.deleted') {
const subscription = event.data.object;
console.log(`Subscription ${subscription.id} canceled`);
// Log to database for churn analysis
}
res.json({received: true});
});
app.listen(3000);incomplete or past_due, not active. Filter explicitly by status: 'active'.Using Stripe Events to Monitor Churn Signals
Beyond canceled subscriptions, Stripe emits events that signal churn risk. Track these early indicators to intervene before customers leave.
Listen for payment failures as churn predictors
Stripe fires invoice.payment_failed when a payment can't be collected. Multiple failures in a row strongly predict cancellation. Set up listeners for both invoice.payment_failed and customer.subscription.updated to catch at-risk customers before they churn.
if (event.type === 'invoice.payment_failed') {
const invoice = event.data.object;
const subscription = invoice.subscription;
const customer = invoice.customer;
console.log(`Payment failed for subscription ${subscription}`);
console.log(`Attempt ${invoice.attempt_count}`);
// Flag high-risk customers
if (invoice.attempt_count >= 2) {
console.log(`High churn risk: customer ${customer}`);
// Trigger retention action: email, discount offer, etc.
}
}
if (event.type === 'customer.subscription.updated') {
const subscription = event.data.object;
console.log(`Subscription ${subscription.id} updated`);
// Track downgrades as expansion churn signals
}Export Stripe data for cohort analysis
Stripe's dashboard is limited for segmenting churn by plan type, region, or acquisition source. Export subscriptions, events, and invoices to a data warehouse. This reveals which customer segments churn fastest and where to focus retention efforts.
customer_id as the join key across Stripe tables. This links cancellations to payment history, plan changes, and invoice patterns for deeper analysis.Common Pitfalls
- Confusing active vs. past-due subscriptions. Stripe's Subscriptions list includes
past_dueby default, but these should be excluded from your churn baseline. Filter explicitly bystatus: 'active'. - Counting failed payments as churn. A payment failure doesn't equal cancellation. Some customers will retry or update their card. Track
invoice.payment_failedas a leading indicator, not churn itself. - Forgetting to account for plan changes and downgrades. When a customer switches from $50 to $10/month, it's not churn—it's contraction. Track
customer.subscription.updatedseparately fromcustomer.subscription.deleted. - Calculating churn with incomplete data. If you start tracking mid-month, your baseline is off. Always use full calendar months and the same date each month for consistency.
Wrapping Up
Churn rate is canceled subscriptions divided by starting active subscriptions. In Stripe, you calculate it using the Subscriptions API for baseline counts and webhooks for cancellation events. Monthly churn of 2–5% is healthy for SaaS; above 7% requires action. Track payment failures and subscription updates as early warning signals. If you want to track churn automatically across Stripe and other tools, Product Analyst can help.