Zero Signup ToolsFree browser tools

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

  1. Pick Parse ISO 8601 and paste any duration string like PT1H30M or P1Y2M3DT4H5M6S to see the breakdown.
  2. Or pick Build ISO 8601, fill in any of the year, month, week, day, hour, minute, and second fields, and copy the resulting string.
  3. Use the example presets to load common durations (YouTube video, recipe time, subscription cycle).
  4. 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

All tools
All toolsDate & Time Tools