Date & Time Tools
ISO 8601 Duration Converter
Parse and build ISO 8601 duration strings like PT1H30M and P1Y2M3DT4H5M6S. Convert to seconds, milliseconds, HH:MM:SS, and human-readable text.
Mode
Paste any ISO 8601 duration (such as PT4M13S or P1Y2M3DT4H5M6S) to see it broken down and converted into seconds, milliseconds, and clock time.
Example presets
Tap any preset to load it into parse mode.
Format: PnYnMnDTnHnMnS. P starts the duration; T separates the date and time parts. Any unit may be a decimal (PT1.5H is 90 minutes). A leading minus sign is supported for negative durations.
ISO 8601 string
PT1H30M
HH:MM:SS
01:30:00
Clock format. Hours may exceed 23.
Total seconds
5400
Canonical numeric duration in seconds.
Total milliseconds
5400000
Multiply by 1000 for JavaScript Date math.
Total minutes
90
Useful for billing and scheduling.
Total hours
1.5
Useful for time tracking.
Total days
0.0625
Calendar units use average year length.
Plain text formats
Human readable
1 hour, 30 minutes
Picks the largest non-zero units.
Compact (Go-style)
1h 30m
1d 2h 3m 4s. Matches time.Duration in Go and many CLI tools.
ISO 8601
PT1H30M
The canonical machine-readable form.
Unit breakdown
Values you supplied or that parsed out of the string. Empty units are shown as zero.
- Years (Y)0
- Months (M)0
- Weeks (W)0
- Days (D)0
- Hours (H)1
- Minutes (M)30
- Seconds (S)0
- Signpositive
ISO 8601 duration cheat sheet
- P starts every duration; without it the value is not an ISO 8601 duration.
- T separates the date part from the time part. Hours, minutes, and seconds must appear after T.
- The letter M means months before T and minutes after T. The T separator is what tells parsers which one you mean.
- W for weeks may not be combined with other date units in strict parsers, but most tools (including this one) allow it.
- Decimal values are valid (PT1.5H, PT0.001S). Use the decimal point, not a comma, for cross-tool compatibility.
- A leading minus sign (-P1D) marks a negative duration. ISO 8601 allows this; some strict parsers reject it.
Where ISO 8601 durations show up
- YouTube Data API: the contentDetails.duration field of every video uses ISO 8601 (PT4M13S).
- Schema.org / JSON-LD: cookTime, prepTime, duration, timeRequired, and many other fields expect ISO 8601.
- XML Schema (xs:duration): the canonical form for durations in any XML-typed system.
- PostgreSQL: the interval type accepts ISO 8601 input and round-trips negative durations.
- .NET TimeSpan and Java Duration: Duration.parse and TimeSpan.Parse both consume ISO 8601 strings.
How to use
- Pick Parse ISO 8601 and paste any duration string like PT1H30M or P1Y2M3DT4H5M6S to see the breakdown.
- Or pick Build ISO 8601, fill in any of the year, month, week, day, hour, minute, and second fields, and copy the resulting string.
- Use the example presets to load common durations (YouTube video, recipe time, subscription cycle).
- Read the HH:MM:SS, total seconds, total milliseconds, and human readable values; copy any line with the Copy button next to it.
About this tool
ISO 8601 Duration Converter parses and builds the PnYnMnDTnHnMnS duration format used across the modern web. Paste any ISO 8601 duration (PT4M13S for a YouTube video, PT1H30M for a course, P1Y for a subscription cycle, P1Y2M3DT4H5M6S for the full compound form, or -P1D for a negative interval) and the tool breaks it into its component years, months, weeks, days, hours, minutes, and seconds, then reports the total seconds and milliseconds, an HH:MM:SS clock view, a plain English breakdown, and a Go-style compact form (1d 2h 3m 4s). A build mode goes the other direction: enter values into the year, month, week, day, hour, minute, and second fields and the converter emits a valid ISO 8601 string you can copy straight into a YouTube API call, a Schema.org JSON-LD video or recipe, an XML Schema xs:duration field, a PostgreSQL interval, a Java Duration.parse argument, or a .NET TimeSpan. Fractional units (PT1.5H, PT0.001S) are fully supported, the T separator is added or omitted automatically so months (M before T) and minutes (M after T) never get mixed up, and a sign toggle handles negative durations for systems that accept them. Calendar units are flagged as approximate: years use the Julian average of 365.25 days and months use 30.4375 days (1 year / 12), matching the constants every spreadsheet, payroll system, and JSON-LD parser uses for average durations. Useful for reading YouTube Data API responses, debugging JSON-LD video and recipe markup, converting xs:duration values out of SOAP and SAML payloads, generating Schema.org cookTime and prepTime fields for recipe sites, building Course duration markup for learning platforms, parsing PostgreSQL interval text, and answering questions like what is PT4M13S in seconds or how do I write 90 minutes as ISO 8601. Every parse and build runs locally in your browser; the duration strings you paste are never uploaded to a server.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Time Duration Calculator
Add and subtract durations in HH:MM:SS, units, or decimal form.
Open tool
Date & TimeSeconds Converter
Convert seconds to every common time unit with HH:MM:SS and human readable output.
Open tool
Date & TimeUnix Timestamp Converter
Convert epoch timestamps to dates and back.
Open tool
Date & TimeDate Format Converter
Re-format any date string into ISO, US, EU, RFC 2822, Unix, or a custom token pattern.
Open tool
Date & TimeTime Format Converter
Convert 12-hour AM/PM and 24-hour military time, single value or batch.
Open tool