{
  "id": "sleep-debt",
  "version": "3604a5b967c2",
  "status": "published",
  "name": "Sleep Debt Calculator",
  "question": "How much sleep debt do I have?",
  "summary": "Adds up your sleep debt: the hours of sleep you needed minus the hours you slept, over a number of nights, with the CDC’s recommended hours for your age and the nights it takes to catch up.",
  "category": "health",
  "subcategory": "body",
  "url": "https://www.acalculator.org/health/sleep-debt-calculator",
  "markdown": "https://www.acalculator.org/health/sleep-debt-calculator.md",
  "kind": "function",
  "method": "Sleep debt = (need − slept) × nights, or 0; nights to catch up = sleep debt ÷ extra sleep a night, rounded up.",
  "assumptions": [
    "The need is the CDC’s recommended minimum for the age group unless you type your own.",
    "Sleeping more than your need on some nights cancels shortfalls on others (the average is used).",
    "Catching up assumes the same extra sleep every night; hours repaid do not measure how rested you feel."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "age": {
        "title": "Age group",
        "description": "Your age group, which sets the CDC’s recommended hours of sleep.",
        "type": "string",
        "enum": [
          "teen",
          "adult",
          "older",
          "senior"
        ]
      },
      "need": {
        "title": "Sleep you need (hours a night)",
        "description": "Optional: the hours you need to feel rested; left empty, the CDC minimum for your age group.",
        "type": "number",
        "minimum": 4,
        "maximum": 14
      },
      "slept": {
        "title": "Sleep you got (hours a night, average)",
        "description": "The average hours you actually slept each night.",
        "type": "number",
        "minimum": 0,
        "maximum": 24
      },
      "nights": {
        "title": "Nights",
        "description": "How many nights to add up, for example 7 for a week.",
        "type": "integer",
        "minimum": 1,
        "maximum": 90
      },
      "extra": {
        "title": "Extra sleep to catch up (hours a night)",
        "description": "How much more than your need you can sleep each night to pay the debt back.",
        "type": "number",
        "minimum": 0.25,
        "maximum": 4
      }
    }
  },
  "outputs": {
    "debt": {
      "label": "Sleep debt (hours)",
      "description": "(Need − slept) × nights; 0 when you slept your need or more.",
      "format": "number"
    },
    "perNight": {
      "label": "Short each night (hours)",
      "description": "Need − slept, a night; 0 or less means no shortfall.",
      "format": "number"
    },
    "needUsed": {
      "label": "Sleep need used (hours)",
      "description": "The need you typed, or the CDC minimum for your age group.",
      "format": "number"
    },
    "recommended": {
      "label": "CDC recommends",
      "description": "The CDC’s recommended sleep for the age group.",
      "format": "text"
    },
    "catchUp": {
      "label": "Nights to catch up",
      "description": "Sleep debt ÷ extra sleep a night, rounded up to whole nights.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "age": "adult",
      "slept": 6,
      "nights": 7,
      "extra": 1
    },
    "outputs": {
      "debt": 7,
      "perNight": 1,
      "needUsed": 7,
      "recommended": "7 or more hours (adults 18 to 60)",
      "catchUp": 7
    },
    "text": "Over 7 nights your sleep debt is 7 hours."
  },
  "examples": [
    {
      "given": {
        "age": "adult",
        "slept": 6,
        "nights": 7,
        "extra": 1
      },
      "expect": {
        "debt": 7,
        "perNight": 1,
        "needUsed": 7,
        "catchUp": 7,
        "recommended": "7 or more hours (adults 18 to 60)"
      },
      "source": "CDC, About Sleep: recommended hours a day, teens 13 to 17 years 8 to 10, adults 18 to 60 years 7 or more, 61 to 64 years 7 to 9, 65 and older 7 to 8, https://www.cdc.gov/sleep/about/index.html (retrieved 2026-10-05); hand calculation in content.mdx: (7 − 6) × 7 = 7 hours; 7 ÷ 1 = 7 nights"
    },
    {
      "given": {
        "age": "teen",
        "slept": 6.5,
        "nights": 5,
        "extra": 1.5
      },
      "expect": {
        "debt": 7.5,
        "perNight": 1.5,
        "needUsed": 8,
        "catchUp": 5
      },
      "source": "CDC, About Sleep: recommended hours a day, teens 13 to 17 years 8 to 10, adults 18 to 60 years 7 or more, 61 to 64 years 7 to 9, 65 and older 7 to 8, https://www.cdc.gov/sleep/about/index.html (retrieved 2026-10-05); hand calculation in content.mdx: (8 − 6.5) × 5 = 7.5 hours; 7.5 ÷ 1.5 = 5 nights"
    },
    {
      "given": {
        "age": "adult",
        "need": 8.25,
        "slept": 7.4,
        "nights": 14,
        "extra": 0.75
      },
      "expect": {
        "debt": 11.9,
        "perNight": 0.85,
        "needUsed": 8.25,
        "catchUp": 16
      },
      "source": "hand calculation in content.mdx: (8.25 − 7.4) × 14 = 11.9 hours; 11.9 ÷ 0.75 = 15.87, so 16 nights"
    },
    {
      "given": {
        "age": "senior",
        "slept": 7.5,
        "nights": 7,
        "extra": 1
      },
      "expect": {
        "debt": 0,
        "perNight": -0.5,
        "catchUp": 0
      },
      "source": "CDC, About Sleep: recommended hours a day, teens 13 to 17 years 8 to 10, adults 18 to 60 years 7 or more, 61 to 64 years 7 to 9, 65 and older 7 to 8, https://www.cdc.gov/sleep/about/index.html (retrieved 2026-10-05); hand calculation in content.mdx: 7 − 7.5 = −0.5, so no debt"
    }
  ],
  "sources": [
    "Centers for Disease Control and Prevention. About Sleep: How much sleep do I need?, retrieved 2026-10-05. https://www.cdc.gov/sleep/about/index.html",
    "National Heart, Lung, and Blood Institute. How Sleep Affects Your Health (sleep deficiency), retrieved 2026-10-05. https://www.nhlbi.nih.gov/health/sleep-deprivation/health-effects"
  ],
  "related": [
    "sleep"
  ],
  "changelog": []
}
