ISO 8601 duration converter
Convert ISO 8601 durations like PT1H30M to seconds or readable text, and back.
ISO 8601 duration converter
Paste ISO 8601 durations such as PT1H30M, P3DT4H or P1Y2M and this tool converts each line to a number of seconds, minutes, hours or days, plus a readable breakdown like "1h 30min". Switch the direction and it works the other way too: paste a plain number of seconds (or whichever unit you pick) and get back a valid ISO 8601 duration string, ready to drop into an API payload, a calendar feed or a config file.
The Unit option decides what the number means, in both directions: when converting from ISO it's the unit the result is expressed in; when building ISO it's the unit your input numbers are read as. Show readable text toggles the human-friendly breakdown alongside the main result. Compact strips zero-valued units from the ISO output (PT1H30M instead of P0Y0M0DT1H30M0S) — turn it off for a fixed-width format with every field present. Decimal places controls rounding on the numeric value and the leftover-seconds component.
ISO 8601 years and months don't have a fixed length, so converting them to seconds is inherently approximate. Count years/months as lets you choose between a calendar average (365.2425 days per year) and a flat 365/30-day approximation — pick whichever your downstream system assumes, and treat any duration with a Y or M component as an estimate either way. Weeks, days, hours, minutes and seconds convert exactly. Turn on Show total of all lines to append a summed line, useful for adding up a batch of task durations.
Everything runs locally in your browser — durations and timestamps often come from internal logs or schedules, and none of it is uploaded anywhere. Copy the result, download it as a .txt file, or send the output back into the input to convert it again in the opposite direction.