Time calculator
This time calculator turns 5400 seconds into 1:30:00, tidies overflowing hours and minutes, splits any seconds total into days, hours, minutes and seconds, and adds or subtracts two durations. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Operation
- Normalize
- Hours
- 1
- Minutes
- 30
- Seconds
- 0
- Total seconds
- 5,400
- Days
- 0
- Formatted result
- 1:30:00
A time calculator for durations, not calendar dates: normalize messy hours and minutes, convert total seconds, and add or subtract two stopwatch-style intervals.
Durations, not clock times
This calculator works with lengths of time, the kind a stopwatch measures, not with dates or times of day, which is why it never needs a calendar or a time zone. You can type the parts the way they come to you, such as ninety minutes, and the calculator reduces everything to a total of seconds before splitting it again into days, hours from 0 to 23, and minutes and seconds from 0 to 59. Parts you leave empty count as zero. The result also comes in a compact form such as 1:30:00, with minutes and seconds always written with two digits and the days in front once the total reaches a full day.
Four everyday jobs it handles
Tidy up an awkward total, such as a training log that adds up to ninety minutes, into one hour and thirty minutes. Turn a long counter of seconds from a recording, a kitchen timer or a sensor into hours and minutes you can read at a glance. Add two intervals, like the sets of a workout, or subtract the time already used from a planned block when one shift hands over to the next. Only whole numbers are accepted, so there is no rounding noise, and a subtraction that would go below zero is rejected rather than turned into a misleading answer.
Normalize any mix of hours, minutes and seconds
Feed hours, minutes and seconds that may exceed sixty — ninety minutes becomes one hour thirty minutes. The tool reduces everything to total seconds and then splits into days, hours zero through twenty-three, minutes and seconds zero through fifty-nine with a stable pretty string.
What you can do with it
Workouts and intervals
Add set durations or normalize a total training time.
Media and recipes
Convert a long second counter into hours and minutes.
Shift handovers
Subtract remaining time from a planned block without a calendar.
FAQ
Can minutes be greater than 59?
Yes on input. Output minutes are always normalized 0–59.
What does pretty look like?
H:MM:SS, or Nd HH:MM:SS when days are greater than zero.
Are floats allowed?
No. Counts must be non-negative integers or digit strings.
How do I subtract one duration from another?
Choose subtraction and enter both durations as hours, minutes and seconds; the second is taken away from the first. If the second is longer the result would be negative, so the calculator refuses it instead of showing a wrong time.
How do I turn a number of seconds into hours and minutes?
Use the option that starts from total seconds. 5400 seconds come back as 1 hour, 30 minutes and 0 seconds, written 1:30:00, and totals of a day or more also show the number of days.
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/dev/time-calculator \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"op":"normalize","hours":0}'const res = await fetch("https://api.kit.forhosting.com/dev/time-calculator", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"op": "normalize",
"hours": 0
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/dev/time-calculator",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"op": "normalize",
"hours": 0
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/dev/time-calculator", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"op":"normalize","hours":0}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"op":"normalize","hours":0}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/dev/time-calculator", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"op": "normalize",
"hours": 0
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "dev.time_calculator",
"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_total_seconds | 999999999999 |
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
Pure integer seconds, no system clock, identical results in browser and API.
From total seconds and back
from_seconds takes a non-negative total and returns the same breakdown and pretty form. That is ideal for logs and sensors that only store epoch-less second counters and need a human-readable duration without floating-point noise.
Add and subtract two durations
Defaults of zero let you omit unused components. No floats or booleans are accepted as counts. add sums two independent h/m/s triples; sub subtracts B from A and rejects a negative result with typed invalid_input.
Pretty format and hard errors
When days are zero, pretty looks like H:MM:SS with minutes and seconds zero-padded. With one or more days it uses Nd HH:MM:SS. Missing total_seconds in from_seconds, unknown ops, non-integers and negative components return invalid_input with stable match substrings.
Integration use cases
Automated checks
Assert total_seconds and pretty in CI fixtures.
Technical questions
Is this a date difference tool?
No. It only handles durations. Use date_diff for calendar dates.
Can subtraction go negative?
No. It returns invalid_input.
Is it free in the browser?
Yes. The native app uses the API at $0.002.