MaximCalculator Free, fun & accurate calculators
😴 Platinum sleep tracker layout
🌙Dark Mode

Sleep Duration Tracker

Log bedtime + wake time and instantly see your sleep duration, 7‑day average, sleep debt, and a Consistency Score designed for screenshots and sharing. Everything runs locally in your browser — no account, no sign‑up.

⏱️Nightly sleep hours in one tap
📈7‑day & 30‑day averages
🎯Goal tracking + sleep debt
📱Screenshot‑friendly “Consistency Score”

Log your sleep

Add each night as a single entry. If your sleep crosses midnight (most people do), this tracker handles it automatically. You can track naps too — just flip the “Entry type”.

📅
Tip: choose the date you went to bed (or keep today).
🌙
☀️
🧾
Naps don’t count toward “consistency” by default, but they do show in totals.
🎯
Common goals: 7.0–9.0 hours for most adults (choose what fits you).
📝
Notes make patterns obvious later. Keep it short.
Your sleep summary will appear here
Add an entry to calculate your nightly sleep duration, weekly averages, and Consistency Score.
Everything is calculated locally in your browser. Your entries are saved on this device only.
Consistency Score: add at least 3 nights to unlock a meaningful score.
ChaoticOkayElite
Last entry duration
7‑day average (nights)
30‑day average (nights)
Sleep debt vs goal (7d)

This tracker estimates time in bed from your inputs. It does not measure sleep stages or clinical sleep quality. If you suspect a sleep disorder, consider talking to a healthcare professional.

Your saved entries (this device)

Entries are stored in localStorage. Clearing browser data will remove them.
🧮 Formula breakdown

How the Sleep Duration Tracker calculates your results

This tracker turns your bedtime and wake time into a single thing: duration. From there, it builds the three numbers that matter most for real life: a rolling average, a sleep debt estimate, and a Consistency Score that rewards “steady” nights over “random” nights.

1) Nightly sleep duration (hours)

For each entry, the calculator converts your times into minutes after midnight. If your wake time is “earlier” than your bedtime (for example, bedtime 11:30 PM and wake time 7:00 AM), the tracker assumes your sleep crossed midnight and adds 24 hours to the wake time.

Duration (minutes) = (wake minutes + dayOffset) − bedtime minutes

Where dayOffset is 0 if wake time is after bedtime, and 1440 minutes if wake time is earlier (meaning it’s the next day). Then it converts minutes to hours:

Duration (hours) = Duration (minutes) ÷ 60

2) 7‑day and 30‑day averages (nights only)

The tracker separates “night sleep” from “naps” so the averages reflect your main sleep. (You’ll still see naps in your history table and totals, but they don’t inflate your nightly average by default.)

For a window like 7 days, the calculator takes the most recent 7 days’ worth of night entries and computes:

Average = (sum of nightly durations) ÷ (number of nights logged)

If you logged fewer nights, it uses what you have — but your average becomes more reliable as your streak grows.

3) Sleep debt vs your goal

Sleep debt is not a perfect scientific concept, but it’s a very useful “reality check.” The tracker asks: if your goal is G hours per night, how far are you above or below that goal across the last 7 nights?

Debt (hours) = (G × N) − (sum of durations over N nights)

If the number is positive, you’re below your goal (debt). If negative, you’re above your goal (surplus). The tracker shows it as a friendly number like “+2h 30m debt” or “−1h 00m surplus”.

4) Consistency Score (0–100)

People often chase “more sleep” but ignore “more consistent sleep.” Your body loves rhythm. So this tool turns your last 7 nights into a Consistency Score.

Step 1: compute the standard deviation (how spread out your nightly durations are). If your nights are very similar, standard deviation is small. If your nights swing wildly, it’s big.

Step 2: convert deviation into a score:

Consistency Score = clamp(100 − (StdDevHours ÷ 2.5 × 100), 0, 100)

This maps about 0 hours deviation to ~100 score, and about 2.5 hours deviation to ~0. Then we clamp it between 0 and 100.

What “good” looks like
  • 90–100: Elite rhythm. Your sleep is extremely stable.
  • 75–89: Solid consistency. You’ll usually feel “predictably okay.”
  • 55–74: Normal life zone. Improvements here often boost energy fast.
  • 0–54: Chaotic schedule. Your body is constantly re-adjusting.

Note: This is a simple tracker, not a medical device. But simple trackers win because you’ll actually use them.

🧪 Examples

Real examples you can copy

Example A: “I sleep enough but feel tired”

Imagine you hit around 8 hours some nights… but you also have 5-hour nights. Your weekly average might look fine, but your Consistency Score will reveal the hidden problem: large swings.

  • Mon: 8.0h
  • Tue: 7.5h
  • Wed: 5.2h
  • Thu: 8.3h
  • Fri: 6.1h
  • Sat: 9.2h
  • Sun: 7.8h

Your average is roughly 7.3h, but your schedule is “spiky,” so your Consistency Score may land in the 50–70 range. Most people feel better fast by reducing the spikes (even without increasing the average).

Example B: “I’m building a sleep streak”

You choose a goal of 7.5h and keep your nights within ±20–30 minutes:

  • 7.3h, 7.6h, 7.4h, 7.7h, 7.5h, 7.6h, 7.4h

Your Consistency Score will usually be very high (often 90+). Even if your average is “only” 7.5h, many people report feeling more awake because their body can predict the pattern.

Example C: Cross-midnight math

Bedtime 11:45 PM, wake time 6:30 AM:

  • Bedtime minutes = 23×60 + 45 = 1425
  • Wake minutes = 6×60 + 30 = 390
  • Wake is “earlier,” so we add 1440: 390 + 1440 = 1830
  • Duration = 1830 − 1425 = 405 minutes = 6.75 hours

That’s 6 hours 45 minutes — and you can see exactly where the number comes from.

Example D: Naps

If you log a nap (say 1:20 PM → 1:55 PM), it will appear in your history and can raise your total sleep for the day, but by default it won’t inflate your nightly averages or your Consistency Score (which is meant to reflect your main rhythm).

🧭 How it works

Step-by-step: from “I slept” to a shareable score

Most trackers overwhelm you with charts. This one is intentionally lightweight: it gives you a repeatable loop you can actually stick with.

  • Step 1: Pick a goal (optional). If you’re unsure, use 8.0 hours and adjust later.
  • Step 2: Each morning, log bedtime + wake time.
  • Step 3: Look at the 7‑day average (your “current reality”).
  • Step 4: Look at the sleep debt number (your “gap”).
  • Step 5: Look at the Consistency Score (your “rhythm”).
  • Step 6: Improve the easiest thing first: reduce swings, then raise average if needed.
Three upgrades that usually work
  • Protect a wake time: the fastest way to stabilize your sleep is to keep wake time steady.
  • Move bedtime slowly: shift 15 minutes earlier every few nights (not 90 minutes in one day).
  • Fix “sleep stealing” habits: late caffeine, late scrolling, late meals, late stress loops.

If your schedule is chaotic (travel, parenting, shift work), you can still benefit: focus on a realistic window (like “I aim for 7–8 hours”) and track the trend rather than chasing a perfect week.

❓ FAQs

Sleep Duration Tracker FAQ

  • Is this measuring actual sleep or time in bed?

    This tool estimates time in bed based on the times you enter. Actual sleep can be lower if you take a long time to fall asleep or wake up during the night. Still, time in bed is a strong “good enough” proxy for most people who want simple tracking.

  • What if I wake up at 2:00 AM and go back to sleep?

    This tracker is “one-entry-per-sleep” to keep it fast. If you want to capture multiple segments, you can add a note (e.g., “awake 2–3am”) or log two entries (a nap entry plus a night entry). The tool stays flexible — it won’t yell at you.

  • Why is Consistency Score based on duration, not bedtime?

    Duration is the simplest thing you can measure accurately with one tap. Bedtime consistency matters too, but many people can’t control bedtime (work, kids, travel). If you want to stabilize bedtime, use the Chronotype Finder and Smart Alarm Window.

  • How many entries do I need for accurate results?

    You’ll get a duration instantly from a single entry. For averages and consistency, results become meaningful after about 3–7 nights. The score is intentionally “sticky” to reduce overreacting to one weird night.

  • What’s a “good” sleep goal?

    Most adults do well around 7–9 hours, but your personal goal depends on your lifestyle and how you feel. A useful approach: pick a goal, track for 2 weeks, then adjust based on energy and mood.

  • Can this help with jet lag?

    Yes — tracking duration and consistency makes it obvious when jet lag is stealing sleep. Pair this with the Jet Lag Recovery Calculator.

  • Do naps “count”?

    Naps count for total rest, but they don’t represent your main nighttime rhythm. That’s why the tool lists naps but keeps them out of the nightly consistency score by default. If you’re a nap-heavy person, use the Nap Length Calculator too.

  • Where is my data stored?

    On your device, in your browser, using localStorage. No servers, no login, no account. If you clear browser storage, the entries disappear — which is why some people screenshot their results for “proof.” 😄

  • Why does my “sleep debt” go negative sometimes?

    That’s a surplus — you slept above your goal over the last week. It doesn’t mean you can “bank” unlimited sleep, but it’s a useful sign your recent recovery is strong.

  • Can I export my sleep entries?

    This simple version focuses on speed + virality. If you want exports, you can copy the table or screenshot it. (If you want, you can add a CSV export button later using the same saved data.)

🔗 Keep exploring

More tools you might like

MaximCalculator provides simple, user-friendly tools. Always treat results as informational, and double-check any important health decisions with a professional.