Convert seconds into a readable duration like 1h 2m 3s and the ISO 8601 form PT1H2M3S, or parse a duration string back into a total number of seconds.
Runs entirely in your browser — your data never leaves your device.
How to use Duration Formatter & Parser
What it does & when you need it
A log line says a job took 93784 seconds. How long is that, really? This tool
converts a raw number of seconds into a readable duration like 1d 2h 3m 4s and the
ISO 8601 form P1DT2H3M4S at the same time — and it works in reverse, parsing a
duration string such as 1h 30m or PT1H30M back into a total number of seconds.
It is handy for reading timeouts, cache TTLs, video lengths, and API fields, all
without leaving your browser.
How to use
Enter a value: a number of seconds like 3723, a readable duration like
1h 2m 3s, or an ISO 8601 duration like PT2H15M.
Read the results: the second count, a short form, a long form, and the ISO 8601
string.
Press Copy result (or Ctrl/Cmd + Enter) to copy everything.
Things worth knowing
ISO 8601 durations. The format is PnDTnHnMnS: a leading P, an optional day
count, a T before the time part, then hours, minutes, and seconds. It turns up in
APIs, databases, and schema definitions, so the tool always shows it next to the
friendly form.
Flexible input. Units accept short or long spellings — h, hr, hour, and
hours all mean the same thing — so 1 hour 30 minutes and 1h30m both resolve to
5400 seconds. A bare number is read as seconds.
Where months stop. Weeks and days convert cleanly at seven days and 24 hours,
but months and years are deliberately left out because their length varies. For
calendar spans between two actual dates, use the
date difference calculator; to work with Unix timestamps,
see the timestamp converter.
Examples
Seconds to a duration
3723
3723 seconds is 1h 2m 3s, or PT1H2M3S in ISO 8601.
A day and a bit
93784
Rolls up neatly into 1d 2h 3m 4s (P1DT2H3M4S).
Parse a duration string
1h 30m
Reads a readable duration back into 5400 seconds.
Parse ISO 8601
PT2H15M
ISO durations are accepted too and resolve to 8100 seconds.
Frequently asked questions
What is the ISO 8601 duration format?+
ISO 8601 writes a duration as PnDTnHnMnS: a leading P, optional day count with D, then a T before the time part with hours (H), minutes (M), and seconds (S). One hour, two minutes, three seconds is PT1H2M3S, and one day two hours is P1DT2H. It appears in APIs, databases, and schema formats, which is why the tool always shows it alongside the readable form.
Which input formats can it parse?+
A compact list such as "1h 2m 3s" or "90m", an ISO 8601 duration such as "PT1H30M", or a bare number, which is read as seconds. Units accept both short and long spellings (h, hr, hour, hours), so "1 hour 30 minutes" and "1h30m" both resolve to 5400 seconds.
How are days and weeks handled?+
When formatting, whole days are pulled out and shown as a leading unit and in the ISO date part (P1DT2H). When parsing, week (w) and day (d) units are accepted and converted at 7 days per week and 24 hours per day. Months and years are deliberately not used, because their length varies.
Does it support fractional seconds?+
Yes. A value like 1.5 seconds is preserved in both the readable output and the ISO form (PT1.5S), and fractional inputs parse correctly. Larger units are always whole numbers; any fractional part is carried in the seconds field.
What happens with invalid input?+
Nothing throws. A negative or non-numeric value to the formatter, or text that is not a recognisable duration, returns a clear error message instead of a result, so the tool degrades gracefully rather than breaking.