Score sleep quality from your night.
Sleep quality is not one thing, so the score is built from three: duration scored against an eight-hour reference, continuity penalised per awakening, and how rested you actually feel — the component that correlates best with next-day function. Late caffeine costs a few points because it fragments sleep even when it does not delay onset. Comparing the components tells you which lever to pull rather than just how bad the night was.
Composite quality score
Score = (50 - |hours - 8| x 12) + (25 - awakenings x 5) + (rested rating - 1)/4 x 25 - 6 if late caffeine, floored at 0
This score is a self-reflection aid, not a clinical measure. Loud snoring, breathing pauses, unrefreshing sleep despite adequate duration or excessive daytime sleepiness should be discussed with a doctor.
Both matter, and they interact. Eight fragmented hours can leave you feeling worse than seven consolidated ones, which is why continuity carries its own weight here.
Brief awakenings are normal and often unremembered. Two or fewer recalled awakenings is typical; frequent long ones point to a fragmented pattern worth investigating.
Caffeine has a half-life of around five hours and reduces deep sleep even when onset is unaffected, which is why it shows up in how rested you feel rather than in how fast you fell asleep.