ISO 8601 duration converter
Turn ISO 8601 durations into readable time and exact seconds when possible.
- 1Add input
- 2Review and run
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Paste a YouTube API duration or another ISO 8601 duration to see readable elapsed time, each component and exact total seconds. Calendar years and months need a start date for an exact second count.
How to use this tool
- Paste an ISO 8601 duration, for example PT1H46M57S from a video API.
- Check the readable time and the component breakdown. If years or months are present, use the calendar warning instead of a fixed second total.
- Copy the readable time or exact seconds, or download the structured JSON.
Supported inputs and limits
Supports standalone weeks, a leading minus sign and up to nine fractional digits on the smallest unit. Weeks cannot be mixed with date or time units.
Years and months have variable lengths. When either is nonzero, the exact total seconds and clock are unavailable without a start date.
Values are processed in your browser. One component may be at most one billion.
Worked example
Example input
PT1H46M57S
Example options
{}Example output
{
"negative": false,
"years": "0",
"months": "0",
"weeks": "0",
"days": "0",
"hours": "1",
"minutes": "46",
"seconds": "57",
"totalSeconds": "6417",
"clock": "01:46:57"
}When something does not work
Enter an uppercase P duration with ordered units. Weeks must stand alone and a fraction must be on the smallest supplied unit.
Frequently asked questions
How do I convert a YouTube API duration to hours, minutes and seconds?
Paste a value such as PT1H46M57S, select Convert ISO duration, then copy 01:46:57. Durations over a day show total elapsed hours.
Why is the total seconds value unavailable for some durations?
A year or month can contain different numbers of days. Supply a start date in another workflow to resolve those calendar units exactly.
Are negative values, weeks and fractions supported?
Yes. Use -P for a negative duration, P1W for standalone weeks, and a fraction on the last supplied unit. Fractions use up to nine decimal digits.
Is my input uploaded?
No. This tool runs in your browser; save any result you need before closing the tab.
Documentation & further reading
Related tools
Timestamp converter
Convert integer Unix timestamps and known-offset dates, with UTC and IANA-zone display.
Time zones and UTC formatting
Resolve time zones and daylight-saving ambiguity, or format an instant in UTC.
Days between dates
Find out just how far apart two dates are.
Add or subtract dates
Add or subtract time from a chosen date.