ISO 8601 Duration Parser
Paste an ISO 8601 duration (for example from APIs, video metadata, or job schedulers). The parser extracts years, months, days, hours, minutes, and seconds, and estimates a total length using average month/year lengths where calendar units are ambiguous.
Nothing is sent to a server.
ISO 8601 duration
Paste a duration such as P1Y2M3DT4H5M6S, P1W, or PT90M.
How it works
ISO 8601 durations start with P (period). Date units (Y, M, D) may appear before an optional T separator; time units (H, M, S) appear after T. A leading PnW form counts whole weeks.
We validate the string with a strict pattern, read each component, then estimate total milliseconds using 7 days per week, average month 30.4375 days, and average year 365.25 days—good for engineering estimates, not legal calendar arithmetic.
Edge cases
- Hidden whitespace or BOM characters can break otherwise valid input.
- Line-ending differences (LF vs CRLF) may affect strict comparisons.
- Large payloads are best tested in chunks to isolate the failing part.
Use this tool for
- Turning a subscription billing period (
P1M) into a rough day count. - Checking API fields like
PT15Mfor cache TTLs or timeouts. - Comparing video or audio runtimes expressed as durations.
Common questions
Why does my total differ from another tool?
Months and years are not fixed lengths in real calendars. We use averages for a single “about how long” number; use day-level durations (PTnH…) when you need exact clock math.