Time Duration Calculator
Turn hh:mm:ss, unit words or ISO 8601 durations into every unit at once — or sum a whole list — entirely on this device.
| Seconds | — | |
|---|---|---|
| Minutes | — | |
| Hours | — | |
| Days | — | |
| h:mm:ss | — | |
| ISO 8601 | — | |
| In words | — |
Press ? for shortcuts
Do it offline:$ awk -F: '{ s += $1*3600 + $2*60 + $3 } END { print s }' durations.txt
How to use it
- Choose a mode: Single converts one duration; Sum totals a pasted list. Switching keeps whatever you typed.
- Enter the value as clock digits (1:30:15), unit words (1h 30m, 90 min), bare seconds (5415) or ISO 8601 (PT1H30M); Sample loads a worked one.
- Read the seven result rows, each with its own copy control; a leading ≈ marks the rare figure that had to round.
- In Sum, scan the per-line table for flagged lines, then copy or download the total and mean.
Type one duration in whichever shape you already have — 1:30:15, 90 min, 5415, PT1H30M — and read it in every unit at once: seconds, minutes, decimal hours, days, h:mm:ss, canonical ISO 8601 and plain English. Or switch to Sum and paste a list, one duration per line, for an exact total and mean. Lengths of time only, never calendar dates — both modes run entirely in this tab.
Examples
1:30:155415The classic timesheet question, hh:mm:ss to seconds: one hour is 3600, thirty minutes 1800, plus 15 makes 5415. The minutes row prints 90.25 exactly; the hours row shows ≈1.504167, rounded half-up at six decimals and marked so.
PT1H30M1:30:00ISO 8601 in, timesheet decimal out: PT1H30M lands as 1:30:00 on the clock row and exactly 1.5 in hours — no ≈, nothing rounded. The ISO-preferred comma decimal PT1,5H parses to the same 5400 seconds.
45:30
1:12:00
25 min
90s2:24:00Three shapes across four lines add exactly: 8640 seconds, 2:24:00, 2.4 decimal hours, mean 2160 seconds (0:36:00). Line 1 draws a chip — two-part 45:30 reads as minutes:seconds here, with 45:30:00 or 45h 30m offered in case hours were meant.
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
PT1M is a minute — P1M is a refused month
In an ISO 8601 duration the letter M flips meaning at the T: PT1M converts to 60 seconds, while P1M denotes one calendar month and is refused — months have no fixed length in seconds. The error says so and points to the date add/subtract calculator.
Two-part values read as minutes:seconds — and say so
45:30 means 45 minutes 30 seconds here — 2730 in total — as a stopwatch split reads. A spreadsheet cell might mean 45 hours 30 minutes, so the reading is never silent: a chip states it and offers 45:30:00 and 45h 30m.
Days and weeks convert at fixed length — DST never bends them
A d or w token, P1DT12H or P2W all convert at exactly 24 hours per day and 7 days per week, and a chip says so: P1DT12H is 129600 seconds. These are lengths, not wall-clock spans — clock-change days are the timezone converter's territory.
≈ marks rounding; separators never appear
Decimal rows print at most nine fraction digits for seconds and six for the rest; a value that had to round half-up carries ≈. Digits are never grouped — two weeks is 1209600 seconds — and a comma in a typed number refuses with a hint: PT1,5H is the one place a comma decimal is standard.
Common errors
"months" is a calendar unit — month and year lengths vary, so this tool refuses them; use the date add/subtract calculator for calendar shifts- Months and years vary in length, so a fixed second count would be a silent guess. Restate the length in fixed units — days, weeks, hours — or shift an actual date on the calculator the message names.
Clock field "90" is out of range — minutes and seconds fields are one or two digits, 0–59- A clock field past 59 is not a time reading. Unit words carry the intent — 90 min or 1h 30m — and over-limit values are legal there: 1h 90m folds to 9000 seconds.
Unrecognized duration "ninety" — try 1:30:00, 90 min, 5415 or PT1H30M- Digits parse; number words don't. The message echoes the token it stopped on and quotes one safe example of every accepted shape. Whatever you typed stays in the field, ready to fix.
Input is larger than the 256 KB limit for this tool. For bigger lists use the CLI: awk -F: '{ s += $1*3600 + $2*60 + $3 } END { print s }' durations.txt- Past 256 KB the page declines the whole paste rather than summing a believable-looking prefix. Such a list is one awk line away: the banner's command totals h:mm:ss lines into seconds without the data leaving your shell.
FAQ
How do I convert hh:mm:ss to decimal hours for a timesheet?
Enter the clock value and read the hours row: 1:30:00 is exactly 1.5 and 8:45:00 exactly 8.75. Stray seconds rarely divide evenly — 1:30:15 shows ≈1.504167, rounded half-up at six decimals — so when cents ride on the figure, bill from the exact seconds row instead.
Why are months and years refused in a duration?
They have no single length — a month runs 28 to 31 days, a year 365 or 366 — so converting 2 months to seconds would quietly pick a policy for you. The refusal names the date add/subtract calculator, which moves a real calendar date instead. Fixed-length units through weeks all convert.
Can I sum durations in different formats in one list?
Yes. Every line parses on its own, so 45:30 can sit above 1:12:00, 25 min and 90s in one paste. Bullets strip with a note, blank lines skip with the original numbering kept, and a failed line is reported by number without blocking the rest. The sum runs in whole nanoseconds, never floats.
Keyboard shortcuts
- ⌘/Ctrl + Enter
- Re-run the active mode on demand; results already follow every edit.
- ⌘/Ctrl + S
- Save the result as a .txt file in place of the browser's save-page dialog.
- ⌘/Ctrl + C
- With focus in the tool and nothing selected, copy the artifact — seven rows in Single, totals and table in Sum; a focused field with a selection keeps native copy.
- ⌘/Ctrl + Shift + C
- Copy the artifact regardless of selection.
- t
- Step the color theme; suppressed while any field has focus.
- ? or ⌘/Ctrl + /
- List every binding on this page in a help dialog.
- Esc
- Dismiss the topmost open dialog.