Sleep cycle calculator
To wake at 07:00 at the end of a cycle, go to bed at 23:15 for five 90-minute cycles or at 21:45 for six, allowing 15 minutes to fall asleep. Enter your alarm time to see every option. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Wake time
- 07:00
- Cycle minutes
- 90
- Cycles
- 6
- Latency minutes
- 15
- Bedtime count
- 6
Waking in the middle of a ninety-minute sleep cycle is what makes an alarm feel brutal even after what should have been enough rest. This sleep cycle calculator takes a desired wake time and counts backward in ninety-minute REM and NREM cycles so you can go to bed at a clock time that lands you at the end of a cycle rather than in deep sleep. It returns a list of bedtimes, one for each completed cycle from the longest option down to a single cycle, after subtracting a fall-asleep latency of fifteen minutes by default.
How ninety-minute sleep cycles turn a wake time into bedtimes
A sleep cycle is the roughly ninety-minute sequence in which the brain moves through light sleep, deep slow-wave sleep, and REM. Waking at the end of a cycle, in lighter sleep, usually feels far kinder than an alarm that cuts through slow-wave sleep, which is why so many people search for a sleep cycle calculator rather than a generic hours-of-sleep table. You supply a desired wake time as a clock string.
The engine converts that clock to minutes since midnight, subtracts the fall-asleep latency, then subtracts one complete cycle, two cycles, three cycles, and so on up to the requested count, wrapping past midnight with modular arithmetic on a 1440-minute day. Each result is a bedtime plus the cycle count, the minutes of sleep that option represents, and the same duration in hours.
Six cycles are nine hours of sleep, five cycles are seven and a half hours, four cycles are six hours, three cycles are four and a half hours, two cycles are three hours, and one cycle is ninety minutes. Adults who want a full night typically pick five or six cycles; shift workers, parents on a broken night, and nap planners use the shorter options.
Who plans bedtimes by sleep cycles
Coaching programs, shift-work planners, and exam-prep sleep hygiene modules can assert the bedtime list against a deterministic oracle instead of hand-maintained spreadsheets that drift when someone forgets midnight wrap. Failed validation does not consume balance. Present the educational disclaimer: ninety-minute cycles are a useful planning heuristic, not a laboratory sleep-stage measurement, and they do not replace clinical advice for insomnia, circadian disorders, or safety-critical work.
Keep requests small, pin the returned bedtimes in tests, and you get reproducible suggestions for widgets, LMS plugins, and edge workers without standing up a sleep-science stack of your own.
What you can do with it
Plan tonight’s bedtime from an alarm
Enter a 07:00 wake time and pick a 5- or 6-cycle bedtime so the alarm rings at the end of a cycle rather than in deep sleep.
Shift work and short-night options
When you must be up at 05:30, list 3- and 4-cycle bedtimes so a truncated night still ends on a cycle boundary.
FAQ
What is a 90-minute sleep cycle?
It is a planning unit for one typical REM–NREM round. This tool does not measure your stages; it only counts complete 90-minute blocks backward from the wake time you provide.
What happens if the wake time is not a valid time?
Send 24-hour HH:MM (00:00–23:59) or 12-hour h:mm AM/PM. Words, dates, and 24:00 are rejected and not billed.
Why is fall-asleep latency fifteen minutes by default?
Most consumer sleep-cycle calculators reserve about a quarter of an hour to fall asleep before the first 90-minute block.
Does this use the current time of day?
There is no Date, no timezone, and no clock read, so the same input always returns the same bedtimes.
How many sleep cycles should I aim for?
Adults who want a full night usually pick five or six cycles, which is seven and a half or nine hours of sleep. Shift workers, parents on a broken night and people planning a nap use the shorter options.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/health/sleep-cycle \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"wake_time":"07:00"}'const res = await fetch("https://api.kit.forhosting.com/health/sleep-cycle", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"wake_time": "07:00"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/health/sleep-cycle",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"wake_time": "07:00"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/health/sleep-cycle", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"wake_time":"07:00"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"wake_time":"07:00"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/health/sleep-cycle", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"wake_time": "07:00"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "health.sleep_cycle",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
An invalid clock string fails with invalid_input instead of inventing a time.
How ninety-minute sleep cycles turn a wake time into bedtimes
This endpoint treats that ninety-minute block as a fixed unit of arithmetic.
Input contract, clock formats, latency, and error behaviour
Pass zero if you want a pure count-back of ninety-minute blocks with no latency. POST a JSON body with one required field, wake_time, plus two optional integers. wake_time is a clock, not a calendar date: 24-hour HH:MM from 00:00 through 23:59, with or without a leading zero, or a 12-hour h:mm AM/PM form such as 7:00 AM or 11:30 PM. Aliases time, wake, and wake_up are accepted and mean the same field. Anything that is not a valid time—empty strings, missing fields, 24:00, 7:60, noon as a word, ISO timestamps with a date, and non-strings that do not parse as a clock—fails with invalid_input naming wake_time, and those failures are not billed. cycles defaults to six and must be an integer from one through twelve; it is the longest option in the list, and the response still includes every shorter count down to one so the caller can present a menu. latency_minutes defaults to fifteen and must be an integer from zero through sixty; it models how long you take to fall asleep and is subtracted before the cycle math, because real rest starts after you drift off, not the moment you lie down. On success the body echoes the normalized wake_time in zero-padded 24-hour HH:MM, cycle_minutes equal to ninety, the cycles and latency_minutes that were applied, bedtime_count, a bedtimes array ordered from most sleep to least, and a short formula string. Pair the list with your own reminder UI if you need notifications; this endpoint only computes clock times.
Where a sleep-cycle bedtime API earns its keep
Wellness apps and bedtime bots can call a tiny parse API to fill a list of go-to-bed suggestions from a user’s alarm without shipping sleep-cycle arithmetic in every client build and without reading the device clock, which keeps tests deterministic.
Integration use cases
Wellness apps and bedtime bots
Embed the same deterministic bedtime list in a chat bot or tracker via the API, tuning latency_minutes per user.
Technical questions
How does the sleep cycle calculator choose bedtimes?
It converts wake_time to minutes since midnight, subtracts latency_minutes (default 15), then subtracts n × 90 minutes for n from cycles down to 1, wrapping on a 24-hour clock. Each n is one row in bedtimes.