How to calculate Customer Churn Rate

Customer churn rate is the percentage of customers who cancel during a period, out of those you had at the start.

Formula

Churn rate = customers lost in period ÷ customers at start of period × 100

SQL query

This example assumes: subscriptions(customer_id, started_at, ended_at). It is written in PostgreSQL syntax; date functions differ slightly in MySQL, BigQuery and SQLite, and your column names will differ from these.

WITH start_set AS (
  SELECT DISTINCT customer_id FROM subscriptions
  WHERE started_at < DATE '2026-10-01'
    AND (ended_at IS NULL OR ended_at >= DATE '2026-10-01')
), lost AS (
  SELECT DISTINCT s.customer_id FROM subscriptions s
  JOIN start_set USING (customer_id)
  WHERE s.ended_at >= DATE '2026-10-01' AND s.ended_at < DATE '2026-11-01'
)
SELECT (SELECT COUNT(*) FROM lost) * 100.0
     / NULLIF((SELECT COUNT(*) FROM start_set), 0) AS churn_pct;

Common mistakes that make Customer Churn Rate wrong

  • Customers who joined and left within the same period are not in the starting set; including them in the numerator overstates churn.
  • A customer who changes plan is not a churned customer; compare customers, not subscription rows.
  • Monthly churn and annual churn are not interchangeable: 3% monthly is not 36% annual.

Ask for Customer Churn Rate in plain English

Instead of writing the query yourself, you can type the question. SchemaChat turns it into SQL against your connected database or uploaded file, runs it, and shows the SQL and the figures it used so you can check the answer before you share it. It does not replace your judgement about the definition: check that the query matches the formula your business uses.

  • What was our customer churn rate last month?
  • Which customer segment churns the most?

Frequently asked questions

What is Customer Churn Rate?
Customer churn rate is the percentage of customers who cancel during a period, out of those you had at the start.
How do you calculate Customer Churn Rate?
Churn rate = customers lost in period ÷ customers at start of period × 100. The SQL example on this page shows the same calculation against a simple table.
What commonly goes wrong when calculating Customer Churn Rate?
Customers who joined and left within the same period are not in the starting set; including them in the numerator overstates churn.