Break-Even Calculator

How many sales a month you need to cover rent, payroll and everything else, your margin of safety today, and revenue vs cost as sales grow. Change any number and it recalculates.

3 steps · shared by Klajdi · September 25, 2026
Make it your own →
No data is shared in this template. It contains only the recipe — column names and SQL logic. When you run it, your data is processed in your own browser and never leaves your machine.

How it works — every step, readable

  1. 01Assumptions — edit these
    SELECT * FROM (VALUES
      ('Average sale', 45, 'USD'),
      ('Variable cost per sale', 18, 'USD'),
      ('Rent', 4500, 'USD per month'),
      ('Payroll', 12000, 'USD per month'),
      ('Other fixed costs', 2500, 'USD per month'),
      ('Sales per month today', 800, 'sales')
    ) AS t(assumption, value, unit)
  2. 02Your break-even point
    WITH p AS (
      SELECT
        MAX(CASE WHEN assumption = 'Average sale' THEN CAST(value AS DOUBLE) END) AS sale,
        MAX(CASE WHEN assumption = 'Variable cost per sale' THEN CAST(value AS DOUBLE) END) AS vc,
        MAX(CASE WHEN assumption = 'Rent' THEN CAST(value AS DOUBLE) END) AS rent,
        MAX(CASE WHEN assumption = 'Payroll' THEN CAST(value AS DOUBLE) END) AS payroll,
        MAX(CASE WHEN assumption = 'Other fixed costs' THEN CAST(value AS DOUBLE) END) AS other,
        MAX(CASE WHEN assumption = 'Sales per month today' THEN CAST(value AS DOUBLE) END) AS today
      FROM input_1
    ), c AS (SELECT *, rent + payroll + other AS fixed, sale - vc AS cm FROM p)
    SELECT metric, amount, unit FROM (
      SELECT 1 AS o, 'Break-even sales per month' AS metric, CEIL(fixed / cm) AS amount, 'sales' AS unit FROM c
      UNION ALL SELECT 2, 'Break-even revenue per month', ROUND(CEIL(fixed / cm) * sale, 2), 'USD' FROM c
      UNION ALL SELECT 3, 'Profit per month today', ROUND(today * cm - fixed, 2), 'USD' FROM c
      UNION ALL SELECT 4, 'Margin of safety', ROUND(100 * (today - fixed / cm) / today, 1), '%' FROM c
      UNION ALL SELECT 5, 'Contribution per sale', ROUND(cm, 2), 'USD' FROM c
      UNION ALL SELECT 6, 'Fixed costs per month', ROUND(fixed, 2), 'USD' FROM c
    ) ORDER BY o
  3. 03Revenue vs cost as sales grow
    WITH p AS (
      SELECT
        MAX(CASE WHEN assumption = 'Average sale' THEN CAST(value AS DOUBLE) END) AS sale,
        MAX(CASE WHEN assumption = 'Variable cost per sale' THEN CAST(value AS DOUBLE) END) AS vc,
        MAX(CASE WHEN assumption = 'Rent' THEN CAST(value AS DOUBLE) END) AS rent,
        MAX(CASE WHEN assumption = 'Payroll' THEN CAST(value AS DOUBLE) END) AS payroll,
        MAX(CASE WHEN assumption = 'Other fixed costs' THEN CAST(value AS DOUBLE) END) AS other,
        MAX(CASE WHEN assumption = 'Sales per month today' THEN CAST(value AS DOUBLE) END) AS today
      FROM input_1
    ), c AS (SELECT *, rent + payroll + other AS fixed, sale - vc AS cm FROM p)
    SELECT
      CAST(ROUND(today * s / 100.0) AS INTEGER) AS sales_per_month,
      ROUND(today * s / 100.0 * sale, 2) AS revenue,
      ROUND(fixed + today * s / 100.0 * vc, 2) AS total_cost,
      ROUND(today * s / 100.0 * cm - fixed, 2) AS profit
    FROM c CROSS JOIN generate_series(0, 200, 20) AS g(s)
    ORDER BY s

Run this on your books

Free to try — no sign-up, no card. The workflow runs in your browser; your data never leaves your machine.

Make it your own →