⏱️ ISO 8601 Duration Converter
ISO 8601 durations look like PT1H30M (1 hour 30 minutes) — this converts them to seconds and HH:MM:SS, or turns seconds back into the string.
ISO-8601 → seconds (years = 365 d, months = 30 d, approximate)
How the iso 8601 duration converter works
An ISO 8601 duration starts with P (period) and lists years, months, weeks and days, then a T separator before hours, minutes and seconds — so PT1H30M is 1 hour 30 minutes, P1DT2H is 1 day 2 hours, and P1W is one week. Parse mode reads that grammar and reports the total in seconds, HH:MM:SS and a human-readable form. Build mode does the reverse, turning a number of seconds into the shortest equivalent duration string (using days and time components).
This format appears all over: YouTube’s Data API returns video lengths as ISO 8601 durations (PT4M13S), and it is used in scheduling, XML/JSON schemas and workflow tools. One ambiguity is deliberate: a bare duration has no anchor date, so calendar years and months have no exact length — this tool uses the common convention of 1 year = 365 days and 1 month = 30 days for the Y and M (before the T) components, and is exact for weeks, days, hours, minutes and seconds. Everything runs locally.
Frequently asked questions
What does PT1H30M mean?
One hour and thirty minutes. The P starts the duration, the T separates the date part from the time part, and H/M/S are hours, minutes and seconds — so PT1H30M = 5400 seconds.
What is the T in an ISO 8601 duration for?
It separates date components (years, months, weeks, days) from time components (hours, minutes, seconds). It matters because M means months before the T but minutes after it: P1M is one month, PT1M is one minute.
How are years and months handled?
A standalone duration has no start date, so Y and M have no fixed length. This converter uses 1 year = 365 days and 1 month = 30 days for those, and is exact for weeks/days/hours/minutes/seconds.
Where are these durations used?
The YouTube Data API returns video durations in this format (e.g. PT4M13S), and it appears in XML Schema, JSON Schema, scheduling systems and many APIs.
Is my input uploaded?
No — parsing and formatting run entirely in your browser and work offline.