Optimal nap length calculator
The optimal nap length calculator turns a 24-hour start time into two clear alarm choices: a 20-minute short restorative nap and a 90-minute full-cycle nap.
Run — free
It shows the exact end time for each option and indicates when that time falls on the following day. The calculation is immediate, deterministic, and designed for planning rather than diagnosis. Choose the shorter option when your available break is limited, or compare it with the longer option when your schedule allows a complete sleep cycle.
Choose the recommendation that matches your available time
Start by entering the hour and minute when you expect the nap to begin, using 24-hour time. The calculator returns two deliberately distinct choices instead of pretending that one duration suits every situation. The short restorative recommendation ends 20 minutes after the entered start time. It is intended for a compact break when you want to reserve only a small part of the day for rest. The full-cycle recommendation ends 90 minutes after the start time, giving you a longer planning window based on a commonly used complete-cycle estimate. Compare both end times with your next fixed commitment, including the time you need to settle down before the nap and regain your bearings afterward. The tool adds only the stated nap duration; it does not silently include an assumed time to fall asleep. If you usually need extra time before sleeping, enter the time at which you realistically expect sleep to start or add your own buffer when setting an alarm.
Read end times and midnight rollover correctly
Each recommendation includes the duration, a formatted end time, separate end-hour and end-minute values, and a day offset. A day offset of zero means the nap ends on the same calendar day as the entered start. A day offset of one means the calculation crossed midnight and the displayed clock time belongs to the next day. This distinction matters for late-evening rests: a nap beginning at 23:30 does not end at an earlier point on the same day merely because the clock display wraps around. The separate numeric fields also make the result convenient for software that needs to construct reminders or compare schedules without parsing a formatted string. Inputs are checked strictly. Hours must be whole numbers from 0 through 23, and minutes must be whole numbers from 0 through 59. Missing fields, numeric strings, decimals, infinities, and other non-numeric values are rejected so that an apparently plausible result cannot hide a malformed request.
Use the result as a planning aid
Nap response varies with sleep debt, age, health, environment, medication, caffeine, and individual sleep patterns. For that reason, the two outputs are schedule recommendations, not promises about how refreshed you will feel and not medical advice. The deterministic calculation is most useful when consistency matters: the same valid start time always produces the same two end times, whether it is run in the browser or through the API. That makes it suitable for personal routines, calendar helpers, wellness tools, and shift-break planners that need transparent arithmetic rather than a probabilistic prediction. Consider practical context before acting on the result. Allow enough time to wake fully before driving, operating equipment, supervising others, or doing safety-critical work. If naps regularly leave you unusually confused, interfere with nighttime sleep, or feel necessary because of persistent excessive sleepiness, a calculator cannot identify the cause. Discuss recurring sleep concerns with a qualified healthcare professional who can consider your circumstances and medical history.
What you can do with it
Plan a lunch-break rest
Compare a 20-minute endpoint with the time you must return, without doing clock arithmetic manually.
Set a late-night alarm
See when a nap crosses midnight and use the day offset to avoid choosing the wrong calendar day.
Add nap choices to a wellness app
Generate stable structured end times for short-restorative and full-cycle options from numeric inputs.
FAQ
What nap lengths does the calculator use?
It uses 20 minutes for the short restorative recommendation and 90 minutes for the full-cycle recommendation.
Does the calculation include time needed to fall asleep?
No. Both durations are added directly to the start time you provide, so any settling or wake-up buffer should be planned separately.
What does day_offset mean?
Zero means the recommendation ends on the same day. One means it ends after midnight on the following day.
Why are numeric strings rejected?
The contract requires actual numeric hour and minute values. Strict validation prevents ambiguous coercion and catches malformed integrations early.
Is this medical advice?
No. It is a deterministic scheduling aid. Consult a qualified healthcare professional about persistent sleep problems or excessive sleepiness.
What does an API request cost?
Each API request costs $0.002. The browser version can be used without sending the calculation to the API.
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/nap-length \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"start_hour":13,"start_minute":40}'const res = await fetch("https://api.kit.forhosting.com/health/nap-length", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"start_hour": 13,
"start_minute": 40
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/health/nap-length",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"start_hour": 13,
"start_minute": 40
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/health/nap-length", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"start_hour":13,"start_minute":40}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"start_hour":13,"start_minute":40}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/health/nap-length", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"start_hour": 13,
"start_minute": 40
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "health.nap_length",
"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. |