ForHosting KIT · Health & fitness

Sleep time calculator

Start from the clock you already know, your alarm or your lights-out, and get times that fall on full 90-minute cycles. For a 07:00 alarm, that means bedtimes of 21:46, 23:16 or 00:46, with 14 minutes to fall asleep built in. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Calculation mode
Calculate bedtime
Time
07:00
You get
Cycle minutes
90
Fall asleep minutes
14
Cycles
6
Times
21:46, 23:16, 00:46, 02:16, 03:46, 05:16

A sleep time calculator answers a scheduling question rather than a medical one: given one clock you already care about, which other clocks let you finish whole 90-minute sleep cycles instead of waking in the middle of deep rest. Send a 24-hour HH:MM time and a mode. In bedtime mode the time is your alarm and the engine works backward to recommended bedtimes. In wake mode the time is when you plan to lie down and the engine works forward to recommended wake times. Each suggestion is spaced by a full 90-minute cycle after a default fourteen-minute fall-asleep delay, wrapping cleanly past midnight.

Ninety-minute cycles, the fall-asleep delay, and the two modes

Adult sleep is organized in repeating cycles that typically last about ninety minutes, moving through lighter stages, deeper slow-wave sleep, and a REM period before starting again. Waking in the middle of slow-wave sleep often feels groggy; waking near a cycle boundary usually feels clearer. This sleep time calculator treats that cycle length as a fixed 90-minute quantum and builds a list of clocks from a single anchor.

For a 07:00 wake time, fourteen minutes of latency, and six cycles the bedtimes are 21:46, 23:16, 00:46, 02:16, 03:46, and 05:16, longest sleep first. In wake mode the anchor is the bedtime you already chose, and the engine adds the same delay plus n times ninety minutes for n from one to cycles, soonest wake first. A 23:00 bedtime with four cycles therefore yields 00:44, 02:14, 03:44, and 05:14.

The tool never reads the system clock, never guesses a timezone, and never consults a calendar date, so the same inputs always produce the same list.

Where a sleep time list earns its keep, pricing, and honest limits

School nights, early shifts, and exam mornings are the usual bedtime-mode job: you know the alarm and you want a short menu of lights-out clocks that land you at a cycle boundary instead of mid-cycle. Nap planning, rotating shifts, and late travel days are the usual wake-mode job: you know when you can lie down and you want the matching rise times one to eight cycles later. Wellness apps, coaching bots, and dorm dashboards can call the same contract instead of re-coding modulo-1440 arithmetic in every client.

Cycle length varies with age, alcohol, sleep debt, and individual physiology, and fourteen minutes is a population convention rather than your personal sleep latency. People with insomnia, suspected sleep apnea, shift-work disorder, or medication effects should follow professional medical advice rather than any single automated list. Keep requests small, pin the returned times in tests, and you get reproducible clocks for homework checkers, LMS plugins, and edge workers without standing up a sleep-lab model of your own.

What clock format does the time field accept?

A 24-hour HH:MM value from 00:00 through 23:59. Unpadded hours such as 7:00 are normalized to 07:00.

Why is there a fourteen-minute fall-asleep delay?

Cycles are counted from sleep onset, not from the moment you lie down.

How many cycle suggestions should I request?

cycles defaults to 6 (nine hours of sleep after onset) and must be an integer from 1 through 8. Use fewer cycles for a short night or a nap; use more when you can protect a longer window.

What is the difference between bedtime mode and wake mode?

In bedtime mode you enter the time you must wake up and get a list of bedtimes, longest sleep first. In wake mode you enter when you lie down and get wake-up times, soonest first.

Why plan sleep around 90-minute cycles?

Adult sleep runs in repeating cycles of about ninety minutes, through lighter stages, deep slow-wave sleep and REM. Waking in the middle of slow-wave sleep often feels groggy, while waking near the end of a cycle usually feels clearer.

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.

POSThttps://api.kit.forhosting.com/health/sleep-time

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.

curl -X POST https://api.kit.forhosting.com/health/sleep-time \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode":"bedtime","time":"07:00"}'
{
  "mode": "bedtime",
  "time": "07:00"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "health.sleep_time",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Strings that are not a valid clock time fail with invalid_input and are not billed. Successful API calls cost $0.002 per item.

Ninety-minute cycles, the fall-asleep delay, and the two modes

In bedtime mode the anchor is the wake-up time you must hit, and the engine subtracts fall_asleep_minutes (default fourteen) plus n times ninety minutes for n from cycles down to one, wrapping with modulo 1440 so a previous-evening bedtime still prints as HH:MM. The fourteen-minute default is the conventional allowance for falling asleep after lights-out; set fall_asleep_minutes to zero if you want cycle math only, or raise it up to sixty when you know you lie awake longer.

Input contract, clock validation, and the response shape

Unpadded hours such as 7:00 are accepted and echoed as 07:00. Values with seconds, a 12-hour AM or PM suffix, 24:00, 25:99, empty strings, and non-strings are rejected as not a valid clock time. Optional cycles is an integer from 1 through 8 and defaults to 6, which covers up to nine hours of sleep after onset. POST a JSON body with two required fields. mode must be bedtime or wake; any other string, including mixed case that does not normalize to those two tokens, fails with invalid_input. time must be a 24-hour clock in HH:MM from 00:00 through 23:59. Optional fall_asleep_minutes is an integer from 0 through 60 and defaults to 14; aliases latency_minutes and latency are accepted. On success the body echoes mode and the normalized time, reports cycle_minutes as 90, repeats fall_asleep_minutes and cycles, and returns two views of the same list: times, a simple array of HH:MM strings you can copy, and suggestions, an array of records with time, cycles, and sleep_minutes so a table can show how much sleep each option represents. sleep_minutes is n times 90 and does not include the fall-asleep delay; time in bed is that duration plus fall_asleep_minutes. Missing mode, missing time, a non-object body, a cycles value outside 1 through 8, and a fall-asleep value outside 0 through 60 all fail with invalid_input naming the field. Those failures are not billed.

Where a sleep time list earns its keep, pricing, and honest limits

The in-browser sleep time calculator is free and uses the identical module as the API. Prepaid API calls use KIT balance at $0.002 per successful item; validation failures never consume balance. This is a scheduling heuristic, not a diagnostic medical device. Do not confuse this endpoint with a sleep efficiency calculator that divides time asleep by time in bed: that is a different search intent and a different pair of minute totals.

Planning tonight's bedtime from an alarm

Enter your wake-up clock in mode=bedtime to see which lights-out times finish whole 90-minute cycles before the alarm.

Naps and rotating-shift rise times

Enter a chosen lie-down clock in mode=wake to list wake targets one to eight cycles later for naps or overnight shifts.

Wellness apps and coaching bots

Embed cycle-aligned times in an app or chatbot via the API, tuning fall_asleep_minutes per user without reimplementing wrap-around clock math.

How does the sleep time calculator pick bedtimes from a wake-up clock?

In mode=bedtime it subtracts fall_asleep_minutes (default 14) and n×90 minutes from the wake time for n from cycles down to 1, wrapping past midnight, and returns those clocks in times and suggestions.

What does a sleep time calculation cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid clock times and other invalid_input errors are not billed.

Read the full KIT documentation →