The ten-field morning form
The standard sleep-diary items, with inline validation and plain-language errors — a generic implementation of the published fields, not a copied instrument.
The idea, animated · no jargon, no black box
A sleep diary is just arithmetic on the times you write down each morning. This page shows that arithmetic happen, one subtraction at a time — how a single night becomes a sleep-efficiency number, why the clock math around midnight is tricky, and how the whole thing can run without ever sending your data anywhere.
Animation: a horizontal bar representing one night in bed fills with jade segments for the time asleep, leaving ink gaps for the time awake, illustrating the sleep-efficiency formula.
If you have insomnia and you’re doing CBT-I, someone has asked you to keep a diary every morning for weeks. The printables you find are static. You write down six or seven times, then you’re supposed to work out — by hand, half-awake — how long you actually slept and how efficient the night was. Every morning. For a fortnight.
The arithmetic isn’t hard. It’s just fiddly, repetitive, and easy to get wrong — especially the part that crosses midnight. That is exactly the kind of job a page can do for you, correctly, every time.
Picture the whole time you spend in bed as a single bar. The parts where you were asleep fill in jade. The parts where you were awake — waiting to drop off, stirring in the night, lying there after the alarm — stay as dark gaps. That strip is the whole idea.
Add up the jade and you have total sleep time. Take the whole bar and you have time in bed. Everything else is bookkeeping.
Take a real-ish night: into bed 23:00, lights out 23:15, twenty-five minutes to fall asleep, thirty-five minutes awake in the small hours, final wake 06:10, up at 06:40. Here is every step, nothing hidden.
SE = TST 355TIB 460 × 100 = 77.2%
That’s it. Sleep efficiency is the share of your time in bed you actually spent asleep. No threshold is applied, no verdict is passed — it’s a measurement, shown with its own formula so you can check it yourself.
Lights out at 23:15, final wake at 06:30. Subtract the clock numbers and you get a negative. A correct diary notices the later event reads an earlier time, adds a whole day, and gets 435 minutes — not a minus sign.
And when the times genuinely don’t make sense — a final wake-up after you got out of bed, or a “night” longer than any real night — the diary refuses to invent a number. It shows a plain error instead of a nonsense one. The screen can never display a negative sleep time.
Sleep is health data. The honest way to keep it private isn’t a privacy policy you have to trust — it’s a page that physically cannot send anything. One line of security policy does that:
Content-Security-Policy:
default-src 'self';
connect-src 'none';
The diary is stored only in your browser’s local storage. There is no account, no cloud, no share link. Because nothing depends on the network, it also works with no signal at all.
The standard sleep-diary items, with inline validation and plain-language errors — a generic implementation of the published fields, not a copied instrument.
SOL, TST and sleep efficiency computed for every night, each printed next to its own formula so nothing is a black box.
Fourteen nights as stacked strips with 7- and 14-day averages — the exact artifact a clinic asks you to bring.
Sleep efficiency and total sleep time drawn as plain SVG lines across every night. No chart library, no network.
A one-page printable handoff for your clinician, a spreadsheet-ready CSV, and a full JSON backup — the only ways data leaves the app.
It computes; it never treats. No sleep-restriction schedules, no bedtime prescriptions, no sensor guesses about “true” sleep.
Enter your mornings, watch the strip and the number appear, print the fortnight when your clinician asks. It stays in your browser — the page can’t send it anywhere.
Open sleepbook →Free · no account · runs 100% offline