Home › Health & Habits › Sleeplog

How to Calculate Hours of Sleep (Including Nights Past Midnight)

Working out how long you slept should be simple, but bedtimes on one side of midnight and wake times on the other trip up a lot of people, and so do minutes that do not divide neatly into hours. A few mistakes and your weekly average is off by an hour.

This guide shows a reliable way to calculate sleep duration by hand, with worked examples, how to turn hours and minutes into decimal hours, how to average a week, and the difference between time in bed and time asleep. It ends with how Sleeplog does the sums for you.

Step by step: hours for one night

  1. Write down your bedtime and wake time in 24-hour format, for example 23:15 and 06:45.
  2. If the wake time is later in the day than the bedtime (both on the same side of midnight), simply subtract bedtime from wake time.
  3. If the night crosses midnight, split it in two: the time from bedtime to midnight, plus the time from midnight to the wake time.
  4. Add the hours and minutes separately. If the minutes come to 60 or more, carry an hour over.
  5. Optionally, subtract the time it took to fall asleep and any long awake periods to estimate time asleep rather than time in bed.

Worked examples

23:15 to 06:45

From 23:15 to midnight is 45 minutes. From midnight to 06:45 is 6 hours 45 minutes. Together that is 6 hours 90 minutes, which is 7 hours 30 minutes.

00:40 to 07:10

Both times are after midnight, so subtract directly: 07:10 minus 00:40 is 6 hours 30 minutes.

22:50 to 06:05

From 22:50 to midnight is 1 hour 10 minutes. From midnight to 06:05 is 6 hours 5 minutes. Together that is 7 hours 15 minutes.

A shortcut for overnight times

If the wake time looks "smaller" than the bedtime, add 24 hours to it before subtracting. For 22:50 to 06:05: 30:05 minus 22:50 is 7 hours 15 minutes, the same answer.

Converting to decimal hours

To average several nights or draw a chart, it is easier to write durations as decimal hours. Divide the minutes by 60:

A common slip is to write 7 hours 30 minutes as 7.3. That is actually 7 hours 18 minutes.

Working out your weekly average

Add the decimal hours for each night and divide by the number of nights. For example, a week of 7.5, 6.5, 7.25, 8, 6.75, 7 and 9 hours adds up to 52 hours. Divided by 7, that is about 7.43 hours, or roughly 7 hours 26 minutes a night.

It is often more revealing to average workdays and days off separately. In the same week, the first five nights average 7.2 hours and the last two average 8 hours. A gap like that is a sign that you may be catching up on sleep at the weekend.

In a spreadsheet

Enter bedtime and wake time as times. In most spreadsheet programs, the formula =MOD(wake-bedtime,1)*24 gives the duration in decimal hours and handles nights that cross midnight, because MOD wraps a negative difference around to the next day.

Time in bed versus time asleep

Bedtime to wake time measures time in bed. Actual sleep is a little shorter, because it takes a while to fall asleep and most people wake briefly during the night. If you were in bed for 7 hours 30 minutes, took about 20 minutes to drop off and were awake for 15 minutes in the night, your estimated sleep is 7 hours 30 minutes minus 35 minutes, which is 6 hours 55 minutes.

These are rough estimates, so do not lie awake checking the clock to get them. For tracking your habits over weeks, time in bed recorded consistently is usually good enough.

General guidance from sleep organisations is that most adults should aim for at least 7 hours a night, while teenagers and children need more. Individual needs vary.

These calculations are for personal record keeping. If you regularly sleep much less or much more than you need, or feel very tired during the day despite enough time in bed, talk to a doctor.

Letting Sleeplog do the sums

Sleeplog calculates the duration as soon as you enter the two times.

  1. On the Record tab, choose the date and enter your bedtime and wake time. Nights that cross midnight are calculated correctly.
  2. Rate your condition before sleep, after waking and the sleep quality from 1 to 5, add a note if you like, and press Save.
  3. Open the Analysis tab and choose a period: 7 days, 14 days, 1 month, 3 months or all.
  4. Read your average sleep time and average quality, and look at the line chart of hours slept to see how the nights vary.
  5. Check your best night and its details, and the general tips shown when your average looks short or long.

Sleeplog records time in bed from the bedtime and wake time you enter; it does not detect when you actually fell asleep. Data in the web version stays in your browser. Sleeplog is also on iPhone and Android. To get the most from your entries, see how to keep a sleep diary.

Frequently asked questions

How many hours is 11 pm to 7 am?

8 hours: 1 hour from 23:00 to midnight plus 7 hours from midnight to 07:00.

How many hours is 10:30 pm to 6 am?

7 hours 30 minutes: 1 hour 30 minutes before midnight plus 6 hours after it, or 7.5 hours.

How do I write 7 hours 45 minutes as a decimal?

Divide 45 by 60 to get 0.75, so it is 7.75 hours.

Should I count the time it takes to fall asleep?

Bedtime to wake time is time in bed. Subtract an estimate of time spent awake if you want time asleep, but keep the method the same every night.

Does Sleeplog work out naps or night wakings?

No. It records one bedtime and one wake time per night and calculates the duration between them. You can mention naps or wakings in the note.