# Sleep Cycle Calculator

> Suggests bedtimes for a given wake-up time, or wake-up times for a given bedtime, so that sleep ends at the boundary of a full sleep cycle (default 90 minutes) after a typical time to fall asleep (default 14 minutes).

- Calculator id: `sleep-cycles` · Category: Everyday Life (`everyday`) · Tool name: `calculate_sleep_cycle_times`
- Canonical page: https://tttkmbb.com/everyday/sleep-cycles · This document: https://tttkmbb.com/everyday/sleep-cycles.md · JSON definition: https://tttkmbb.com/everyday/sleep-cycles.json

## Purpose

Suggests bedtimes for a given wake-up time, or wake-up times for a given bedtime, so that sleep ends at the boundary of a full sleep cycle (default 90 minutes) after a typical time to fall asleep (default 14 minutes).

**Use when:** You want to pick a bedtime or alarm time that completes 3–6 whole sleep cycles instead of waking mid-cycle.

**Do not use when:** You have a sleep disorder or shift-work schedule needing clinical advice; cycle length varies between people and through the night, so treat the times as approximations.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mode` | enum: wake_up_at \| go_to_bed_at |  | required | Whether the given time is the wake-up time or the time you go to bed. |
| `time` | string |  | required | The known wake-up time or bedtime, 24-hour HH:MM. |
| `fall_asleep_minutes` | integer | min | optional, default 14 | Average sleep-onset latency; 10–20 minutes is typical for healthy adults. (min 0, max 120) |
| `cycle_minutes` | integer | min | optional, default 90 | Length of one sleep cycle; 90 minutes is the usual average (range about 70–120). (min 60, max 120) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `suggested_times` | string_list |  | Bedtimes (for wake_up_at, earliest first: 6, 5, 4, 3 cycles) or wake-up times (for go_to_bed_at: 3, 4, 5, 6 cycles), HH:MM. |
| `sleep_cycles` | number_list |  | Number of full cycles for each suggested time, in the same order. |
| `sleep_hours` | number_list | h | Hours of actual sleep for each suggested time. |
| `schedule` | list |  | Objects with cycles, time and sleep_hours for each suggestion. |

## Formula

`wake_up_at: bedtime = time − fall_asleep_minutes − n × cycle_minutes; go_to_bed_at: wake time = time + fall_asleep_minutes + n × cycle_minutes; n = 3…6 (4.5–9 h of sleep at 90-minute cycles)`

A night's sleep consists of 4–6 cycles of roughly 90 minutes that progress through light, deep and REM sleep; waking at the end of a cycle tends to feel less groggy. Adults are advised to sleep 7–9 hours, i.e. 5–6 cycles.

## Data Sources

- NIH NINDS – Brain Basics: Understanding Sleep — https://www.ninds.nih.gov/health-information/public-education/brain-basics/brain-basics-understanding-sleep (government, retrieved 2026-09-23)
- Sleep cycle (Wikipedia) — https://en.wikipedia.org/wiki/Sleep_cycle (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/sleep-cycles?mode=…&time=…`
- `POST https://tttkmbb.com/api/v1/calculate/sleep-cycles` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/sleep-cycles · OpenAPI operationId `calculate_sleep_cycle_times` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "sleep-cycles", "inputs": {…}}`

## Example

- Wake up at 06:30: inputs `{"mode":"wake_up_at","time":"06:30"}` → `{"suggested_times":["21:16","22:46","00:16","01:46"],"sleep_cycles":[6,5,4,3],"sleep_hours":[9,7.5,6,4.5]}`
- Go to bed at 23:00: inputs `{"mode":"go_to_bed_at","time":"23:00"}` → `{"suggested_times":["03:44","05:14","06:44","08:14"],"sleep_cycles":[3,4,5,6],"sleep_hours":[4.5,6,7.5,9]}`

```
GET https://tttkmbb.com/api/v1/calculate/sleep-cycles?mode=wake_up_at&time=06%3A30
```

## Limitations

You have a sleep disorder or shift-work schedule needing clinical advice; cycle length varies between people and through the night, so treat the times as approximations. A night's sleep consists of 4–6 cycles of roughly 90 minutes that progress through light, deep and REM sleep; waking at the end of a cycle tends to feel less groggy. Adults are advised to sleep 7–9 hours, i.e. 5–6 cycles. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which suggestion should I choose?**

Prefer 5 or 6 cycles (7.5–9 h); 3–4 cycles is a fallback for a short night, not a healthy routine.

**Are sleep cycles really 90 minutes?**

On average. Individual cycles range from about 70 to 120 minutes and lengthen through the night, so the suggested times are estimates to be fine-tuned by how you feel on waking.

## Related

- [Time Duration Calculator](https://tttkmbb.com/everyday/time-duration.md) — Hours between bedtime and wake-up time.
