ISO 8601 Duration Converter

Enter an ISO 8601 duration to parse, or total seconds to format.

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

ISO 8601 is the international standard for writing dates, times, and durations so that computers everywhere parse them the same way. Its duration format packs years, months, weeks, days, hours, minutes, and seconds into one string that opens with P (for “period”) and inserts a T before any time-of-day components — so P1DT2H30M reads as 1 day, 2 hours, 30 minutes, with no locale-dependent word order to trip up a parser.

This exact notation is what XML Schema’s xs:duration type stores, what iCalendar (RFC 5545) uses for event durations, and what REST APIs from AWS, Google Calendar, and Stripe return for elapsed-time fields; language libraries like Java’s Duration/Period classes and Python’s isodate module read and write it natively. Converting a duration string to total seconds means summing each designator’s value times its unit (days×86400, hours×3600, minutes×60, seconds×1); going the other way means peeling seconds off in the same order and re-assembling the P/T string — which is exactly what this converter automates, along with a human-readable breakdown.

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators