ForHosting KIT · Health & fitness

Sleep efficiency calculator

Divide the minutes you slept by the minutes you spent in bed: 390 asleep out of 480 in bed gives 81.25% sleep efficiency and 90 minutes awake in bed. It is the standard figure in sleep diaries. 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
Time asleep
390
Time in bed
480
You get
Wake minutes
90 percent
Sleep efficiency
81.25

Sleep efficiency is the share of time in bed that you actually spend asleep, expressed as a percentage. Clinicians, sleep coaches, and diary apps use it as a compact quality signal: high efficiency means most of the night was sleep, while low efficiency often reflects long sleep latency, frequent awakenings, or time spent awake after sleep onset. This sleep efficiency calculator accepts total sleep time and time in bed in minutes, divides asleep by in-bed, multiplies by one hundred, and returns a stable percentage plus wake minutes still spent in bed.

What sleep efficiency means and how the percentage is defined

Sleep efficiency, often abbreviated SE, is defined as total sleep time divided by time in bed, then scaled to a percentage. Total sleep time (TST) is the minutes you were actually asleep—night sleep after subtracting sleep onset latency and any wake after sleep onset that still counts as time in bed. Time in bed (TIB) is the span from when you intend to sleep (lights out or getting into bed for the night) until you finally get up for the day.

If you spent eight hours in bed and slept six and a half of them, efficiency is six hundred fifty minutes over four hundred eighty minutes times one hundred, which is about eighty-one percent. That single ratio does not diagnose a disorder by itself, but it is a standard summary in sleep diaries and many research protocols because it captures wasted bed time without requiring polysomnography.

Common coaching targets often aim for roughly eighty-five percent or higher when consolidating a sleep window, though individual goals should come from a qualified clinician. Minutes are the natural unit for diary rows and wearable exports; convert hours to minutes before calling if your source logs decimal hours. Wake minutes returned alongside efficiency are simply time in bed minus time asleep, so you can show how much of the night was spent awake while still in bed.

Who relies on sleep efficiency, and why

Sleep diary apps and CBT-I homework trackers need a deterministic oracle so every client—mobile, web, or spreadsheet import—agrees on the percentage for the same two minute counts. Coaching platforms batch-score weekly diaries without standing up a full sleep-analytics stack. Failed validation does not consume balance.

Keep requests small, pin the rounded percentage in tests, and you get reproducible sleep efficiency for diaries, LMS modules, and edge workers without hosting custom scoring infrastructure of your own.

Sleep diary and CBT-I homework

Convert nightly time-asleep and time-in-bed minutes into a stable sleep efficiency percentage for worksheets and weekly reviews.

Research and export cleanup

Validate actigraphy or self-report exports by rejecting impossible rows where asleep minutes exceed time in bed.

What units should I use?

Convert hours to minutes first (for example, 7.5 hours is 450 minutes).

What if time asleep is greater than time in bed?

Classic sleep efficiency requires total sleep time less than or equal to time in bed; values above 100% are not returned.

Does this diagnose a sleep disorder?

No. It only computes the arithmetic ratio used in sleep diaries. Clinical interpretation belongs to a qualified professional.

What is a good sleep efficiency percentage?

Coaching targets often aim for roughly 85% or higher when consolidating a sleep window. Treat it as a common benchmark rather than a personal goal: your own target should come from a qualified clinician.

What counts as time in bed and time asleep?

Time in bed runs from lights out, or getting into bed for the night, until you finally get up for the day. Time asleep is what remains after taking away the time it took to fall asleep and any awakenings.

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-efficiency

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-efficiency \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"time_asleep":390,"time_in_bed":480}'
{
  "time_asleep": 390,
  "time_in_bed": 480
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "health.sleep_efficiency",
  "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.

Invalid values—missing fields, non-positive durations, or asleep minutes greater than bed minutes—fail with a clear invalid_input error instead of inventing a percentage above one hundred.

What sleep efficiency means and how the percentage is defined

This calculator implements only the arithmetic definition: SE equals time_asleep over time_in_bed times one hundred. It does not estimate stages, apnea risk, or circadian phase.

Input contract, response shape, and error behaviour

Both values must be strictly greater than zero. Missing fields, empty strings, NaN, Infinity, and non-positive values also fail with messages that name the field. Those validation failures are not billed. Example: three hundred ninety minutes asleep and four hundred eighty minutes in bed yields eighty-one point two five percent efficiency and ninety wake minutes. POST a JSON body with two required finite numbers in minutes: time_asleep (total sleep time) and time_in_bed (time in bed from lights-out or getting into bed until final rise). If time_asleep is greater than time_in_bed the request fails with invalid_input, because the classic definition does not allow more sleep than bed time and percentages above one hundred percent would mislead diary summaries. On success the body echoes cleaned time_asleep and time_in_bed, wake_minutes as their difference, sleep_efficiency as the percentage rounded for stable cross-runtime comparison, unit set to percent, the formula string SE (%) equals time_asleep over time_in_bed times one hundred, and method sleep_efficiency. Pair the number with your own bands or coaching copy if you need clinical cut-offs; this endpoint computes the ratio only and does not emit stage charts, device integration, or medical advice.

Where a sleep efficiency API earns its keep

Research assistants cleaning actigraphy or self-report exports can call a tiny parse endpoint instead of reimplementing edge cases for zero bed time or asleep greater than in bed.

Coaching and wellness dashboards

Batch-score client diary rows with the same ratio the free browser widget uses, without reimplementing validation edge cases.

How is sleep efficiency calculated?

Sleep efficiency SE (%) = (time_asleep / time_in_bed) × 100. Send both values in minutes; the API returns the percentage, wake minutes in bed, and the formula string.

What does the sleep efficiency calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →