Humanize duration
Paste a duration in seconds and get wording a person can read at a glance: 183840 seconds is 2 days 3 hours 4 minutes. Units that come out as zero are left out, and the phrase is in English. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Duration length in seconds
- 183,840
- Input seconds
- 183,840
- Days
- 2
- Hours
- 3
- Minutes
- 4
A humanize duration formatter answers a practical question that shows up in logs, dashboards, and product copy: given a length of time as a raw number of seconds, what should a person read? Enter a non-negative duration in seconds and this tool returns a compact English phrase built from whole days, hours, minutes, and seconds—for example one hundred eighty-three thousand eight hundred forty seconds becomes two days three hours four minutes.
What humanizing a duration means and which units appear
A duration is a length of time, not a calendar timestamp. When systems store elapsed time they almost always use a single non-negative count of seconds because that unit is easy to add, subtract, and serialize. Humans, however, struggle to parse large second counts at a glance: ninety seconds is obviously a minute and a half, but one hundred eighty-three thousand eight hundred forty seconds is not obviously two days and a few hours.
Humanizing means decomposing that total into the familiar ladder of whole days of eighty-six thousand four hundred seconds, hours of three thousand six hundred seconds, minutes of sixty seconds, and leftover seconds. Intermediate units that evaluate to zero are omitted so the phrase stays short—one day five minutes rather than one day zero hours five minutes—while an all-zero input still prints zero seconds so callers never receive an empty string. Singular and plural English labels follow ordinary grammar: one hour versus two hours, one minute versus two minutes.
Practical tips, limits, and related searches
Prefer sending numbers rather than pre-formatted strings when you control the client; string numbers are accepted only when they match a strict finite numeric pattern. Keep durations inside the published maximum so large multiplications never become non-finite. When teaching or testing, keep a small known set: a pure multi-unit success case such as two days three hours four minutes, a short mix such as one minute thirty seconds, a zero-second case, a fractional input that floors cleanly, and a deliberate negative failure.
Round-trip checks are easy: recompute days times eighty-six thousand four hundred plus hours times three thousand six hundred plus minutes times sixty plus seconds and confirm the sum equals the published whole seconds field. This landing targets people searching for a humanize duration formatter, seconds to days hours minutes, or readable elapsed time online; it is not a calendar date formatter, not a timezone converter, not an uptime monitor, and not a natural-language softener for prose.
Prefer this capability when you already have a second count and only need a stable English phrase; if you need localized month names or weekday labels from a calendar date, use a date formatting or day-of-week capability instead. Document the floor rule in client comments so product copy writers know that half a second never rounds up to a full second in this tool.
What you can do with it
Incident and SLA elapsed-time copy
Status pages and postmortems convert raw second counters into phrases like two hours fifteen minutes that non-engineers can read without mental arithmetic.
Unit-test expected strings for timers
Engineering teams pin humanized labels for countdowns, job runtimes, and media lengths so UI snapshots stay deterministic across browsers.
Classroom elapsed-time exercises
Students submit a second total and check the printed day-hour-minute-second breakdown against a deterministic result before handing in worksheets.
FAQ
What happens with a negative duration?
Negative lengths are rejected rather than absolute-valued or pretty-printed.
Which units appear in the human-readable string?
Whole days, hours, minutes, and seconds. Zero intermediate units are omitted; an all-zero duration prints as "0 seconds".
Does this format calendar dates or timestamps?
No. It only humanizes a pure duration length. Use date formatting or day-of-week tools when you have a calendar date.
Is the humanize duration formatter free?
The browser tool is free and runs locally.
How can I check that the phrase is right?
Multiply the days by 86400, the hours by 3600 and the minutes by 60, then add the seconds. The sum should equal the whole seconds you entered; for 2 days 3 hours 4 minutes it gives 183840.
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/date/humanize-duration \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"seconds":183840}'const res = await fetch("https://api.kit.forhosting.com/date/humanize-duration", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"seconds": 183840
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/humanize-duration",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"seconds": 183840
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/humanize-duration", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"seconds":183840}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"seconds":183840}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/humanize-duration", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"seconds": 183840
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.humanize_duration",
"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.
Limits
max_seconds | 1000000000000 |
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
Zero is allowed and prints as zero seconds; negative values are rejected with a clear invalid_input error instead of a misleading absolute value.
What humanizing a duration means and which units appear
Negative lengths are outside the product intent: an elapsed timer that went backward is a data error, not a phrase to pretty-print, so validation fails with invalid_input naming the seconds field.
How to call the API and what comes back
Fractional inputs are accepted and floored to whole seconds before the unit split so floating noise cannot flip a near-integer boundary. When you assert results in tests, prefer comparing the human field (or text) and the numeric breakdown rather than reconstructing labels by hand, because singular and plural forms are part of the published contract. Send a JSON body with one required finite number named seconds, which may also be supplied under the aliases duration, value, secs, or s. Absolute values must stay within the published maximum of one trillion seconds so intermediate products remain finite on the Worker and in the browser. On success the response echoes seconds as the floored whole total, optionally input_seconds when the raw value differed, days, hours, minutes, and secs as non-negative integers that recombine to the total, human and text as the same English phrase, message as a short summary sentence, and steps as an ordered array describing the floor and breakdown. Failed validation—missing field, non-finite numbers, values above the maximum, or any negative duration—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.
Practical tips, limits, and related searches
Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately send negative values.
Technical questions
What input does the humanize duration formatter accept?
One non-negative finite number of seconds (field seconds, or aliases duration, value, secs, s). Fractional values are floored to whole seconds.