Sleep Duration Calculator
Find how long you slept from bedtime to wake time.
24-hour format, HH:MM
24-hour format, HH:MM
Results update as you type.
How it works
A sleep duration calculator works out how long you slept from the time you went to bed to the time you woke up, correctly handling the usual case where sleep runs across midnight. Enter a bedtime of 23:00 and a wake time of 07:00 and it returns eight hours, rather than the negative or wrong figure a naive subtraction would give. The overnight wrap is the whole difficulty. Because bedtime is usually before midnight and wake time after it, subtracting the clock values directly gives a negative number, so the calculator adds a full 24 hours whenever the wake time is at or before the bedtime. This turns "23:00 to 07:00" into a clean eight-hour span. Working in minutes past midnight and then dividing by sixty keeps the result exact, including half-hours and quarter-hours. Knowing your actual sleep duration matters for tracking sleep habits against the commonly recommended seven to nine hours for adults, spotting short nights, and timing naps. It is the raw figure behind sleep diaries and many wellness routines. People logging their rest, parents tracking a child's sleep, and anyone comparing bedtime routines use a sleep duration calculator to convert two clock times into hours slept. It measures time in bed between the two points and is a personal tracking aid, not medical advice.
hoursSlept = (wakeTime − bedTime, +24h if wake ≤ bed) ÷ 60, working in minutes past midnight
Both times are converted to minutes past midnight. If the wake time is at or before the bedtime, the sleep clearly crossed midnight, so 1,440 minutes — a full day — is added to the wake time to place it on the following day. Subtracting the bedtime from that adjusted wake time gives the sleep span in minutes, which is divided by sixty for hours. Working in minutes and adding a day when needed is what lets a normal overnight sleep produce a correct positive duration.
Source:Gregorian calendar / ISO 8601
We review all our tools from time to time to ensure accuracy.
Worked example
How to use this calculator
- 1
Enter your values
Enter bedtime and wake time.
- 2
Adjust the options
Fine-tune any options to match your situation.
- 3
Read your result
Hours slept updates instantly as you type — no button to press.
Frequently asked questions
How does it handle sleeping past midnight?
When the wake time is at or before the bedtime on the clock, the calculator assumes you slept overnight and adds 24 hours to the wake time before subtracting. So 23:00 to 07:00 becomes an eight-hour span rather than a negative figure. This overnight handling is the main thing the tool does, since most sleep crosses midnight and a plain clock subtraction would otherwise give the wrong answer.
How do I enter the times?
Use 24-hour format as HH:MM, so 11 at night is 23:00 and 7 in the morning is 07:00. For a bedtime after midnight, such as 1 AM, enter 01:00, and the calculator still measures forward to your wake time. Entering times in 24-hour form avoids AM/PM confusion, which is easy to make when sleep spans the midnight boundary between one day and the next.
What if I nap during the day?
For a daytime nap where you lie down and get up on the same afternoon, enter the start and end times normally and the calculator returns the gap directly. The overnight rule only adds a day when the wake time is at or before the bedtime, so a 14:00 to 15:30 nap correctly reads as one and a half hours. For very long naps that cross midnight, the same overnight handling applies automatically.
How many hours of sleep should I get?
Most adults are commonly advised to aim for seven to nine hours a night, with children and teenagers needing more, but individual needs vary and this is general guidance rather than medical advice. The calculator measures the time between your bedtime and wake time, which is time in bed rather than true sleep, since it cannot know how long you were actually asleep. Use it as a tracking aid and consult a professional for sleep concerns.
Does it measure time in bed or actual sleep?
It measures the elapsed time between the bedtime and wake time you enter, which is time in bed. Actual sleep is usually a little less, because it takes time to fall asleep and there may be brief awakenings. If you know roughly how long you were awake in bed, subtract that to estimate true sleep. For precise sleep staging you would need a wearable or a sleep study rather than a clock-time calculation.