{
  "id": "sleep",
  "version": "01360a27a18a",
  "status": "published",
  "name": "Sleep Calculator",
  "question": "When should I go to sleep?",
  "summary": "Finds bedtimes that let you wake up at the end of a 90-minute sleep cycle, or wake-up times for a given bedtime, allowing for the minutes it takes to fall asleep.",
  "category": "health",
  "subcategory": "body",
  "url": "https://www.acalculator.org/health/sleep-calculator",
  "markdown": "https://www.acalculator.org/health/sleep-calculator.md",
  "kind": "function",
  "method": "Bedtime = wake-up time − minutes to fall asleep − cycles × 90 minutes; wake-up time = bedtime + minutes to fall asleep + cycles × 90 minutes; times wrap past midnight.",
  "assumptions": [
    "A sleep cycle lasts 90 minutes. Real cycles run about 90 to 110 minutes and vary through the night.",
    "Waking at the end of a cycle, not in the middle of deep sleep, is assumed to feel easier.",
    "Adults need 7 hours of sleep or more (AASM and Sleep Research Society), so 5 or 6 cycles is the main answer; 4 cycles (6 hours) is short.",
    "This is general guidance, not medical advice."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "mode": {
        "title": "I know my",
        "description": "Whether you know the time you must wake up, or the time you go to bed.",
        "type": "string",
        "enum": [
          "wake",
          "bed"
        ]
      },
      "wake": {
        "title": "Wake up at",
        "description": "The time you want to wake up.",
        "type": "string",
        "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
      },
      "bed": {
        "title": "Go to bed at",
        "description": "The time you go to bed.",
        "type": "string",
        "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
      },
      "latency": {
        "title": "Minutes to fall asleep",
        "description": "How long it usually takes you to fall asleep once in bed.",
        "type": "integer",
        "minimum": 0,
        "maximum": 60
      }
    }
  },
  "outputs": {
    "bed5": {
      "label": "Go to bed at",
      "description": "The bedtime for 5 full sleep cycles (7 hours 30 minutes of sleep).",
      "format": "time"
    },
    "bed6": {
      "label": "Or, for 6 cycles (9 h of sleep)",
      "description": "The bedtime for 6 full sleep cycles (9 hours of sleep).",
      "format": "time"
    },
    "bed4": {
      "label": "Or, for 4 cycles (6 h of sleep)",
      "description": "The bedtime for 4 full sleep cycles (6 hours of sleep).",
      "format": "time"
    },
    "wake5": {
      "label": "Wake up at",
      "description": "The wake-up time after 5 full sleep cycles (7 hours 30 minutes of sleep).",
      "format": "time"
    },
    "wake6": {
      "label": "Or, after 6 cycles (9 h of sleep)",
      "description": "The wake-up time after 6 full sleep cycles (9 hours of sleep).",
      "format": "time"
    },
    "wake4": {
      "label": "Or, after 4 cycles (6 h of sleep)",
      "description": "The wake-up time after 4 full sleep cycles (6 hours of sleep).",
      "format": "time"
    },
    "asleep": {
      "label": "You fall asleep at about",
      "description": "The bedtime plus the minutes it takes to fall asleep.",
      "format": "time"
    },
    "summary": {
      "label": "In short",
      "description": "The main answer as one sentence.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "mode": "wake",
      "wake": "07:00",
      "bed": "23:00",
      "latency": 15
    },
    "outputs": {
      "bed5": "23:15",
      "bed6": "21:45",
      "bed4": "00:45",
      "summary": "To wake up at 7:00 AM after 5 full sleep cycles, go to bed at 11:15 PM."
    },
    "text": "To wake up at 7:00 AM after 5 full sleep cycles, go to bed at 11:15 PM."
  },
  "examples": [
    {
      "given": {
        "mode": "wake",
        "wake": "07:00",
        "latency": 15
      },
      "expect": {
        "bed5": "23:15",
        "bed6": "21:45",
        "bed4": "00:45",
        "summary": "To wake up at 7:00 AM after 5 full sleep cycles, go to bed at 11:15 PM."
      },
      "source": "NINDS (sleep cycles about 90 minutes); hand calculation in content.mdx"
    },
    {
      "given": {
        "mode": "wake",
        "wake": "06:30",
        "latency": 0
      },
      "expect": {
        "bed5": "23:00",
        "bed6": "21:30",
        "bed4": "00:30"
      },
      "source": "hand calculation in content.mdx"
    },
    {
      "given": {
        "mode": "bed",
        "bed": "22:30",
        "latency": 20
      },
      "expect": {
        "asleep": "22:50",
        "wake5": "06:20",
        "wake6": "07:50",
        "wake4": "04:50"
      },
      "source": "NINDS (sleep cycles about 90 minutes); hand calculation in content.mdx"
    },
    {
      "given": {
        "mode": "bed",
        "bed": "01:00",
        "latency": 15
      },
      "expect": {
        "asleep": "01:15",
        "wake5": "08:45"
      },
      "source": "hand calculation in content.mdx"
    }
  ],
  "sources": [
    "National Institute of Neurological Disorders and Stroke. Brain Basics: Understanding Sleep. https://www.ninds.nih.gov/health-information/public-education/brain-basics/brain-basics-understanding-sleep",
    "Patel AK, Reddy V, Shumway KR, Araujo JF. Physiology, Sleep Stages. In: StatPearls. StatPearls Publishing; 2024. https://www.ncbi.nlm.nih.gov/books/NBK526132/",
    "Watson NF, Badr MS, Belenky G, et al. Recommended amount of sleep for a healthy adult: a joint consensus statement of the American Academy of Sleep Medicine and Sleep Research Society. J Clin Sleep Med. 2015;11(6):591-592. https://doi.org/10.5664/jcsm.4758",
    "Centers for Disease Control and Prevention. About Sleep (recommended hours by age). https://www.cdc.gov/sleep/about/index.html"
  ],
  "related": [
    "bmi",
    "tdee"
  ],
  "changelog": [
    {
      "date": "2026-09-28",
      "note": "The bedtime summary says \"fall asleep at once\" for 0 minutes and \"1 minute\" for 1."
    }
  ]
}
