Toolstia / ISO 8601 duration converter

ISO 8601 duration converter

Paste a duration like P1Y2M3DT4H5M6S to see it in words and as a number of seconds, or fill in the boxes to build a valid duration code.

Build a duration

An ISO 8601 duration starts with P, then years (Y), months (M), weeks (W) and days (D), then T and hours (H), minutes (M) and seconds (S). For example PT90M is 90 minutes and P2W is two weeks. It is used in video metadata, calendars and APIs.

How it works

  1. Type or paste an ISO 8601 duration.
  2. Read the meaning and the total seconds.
  3. Or fill in the build boxes and copy the code.

The format

P starts every duration, then Y for years, M for months, W for weeks and D for days. After T come H for hours, M for minutes and S for seconds.

Months and minutes

M means months before the T and minutes after it. PT5M is five minutes and P5M is five months.

Total seconds

Weeks, days, hours, minutes and seconds have fixed lengths. Years and months do not, so the total is marked approximate.

Where it is used

Video and recipe metadata, calendar events, subscription periods and many web APIs.

Questions

Is P1W1D allowed?

Many systems accept it, though the strict standard keeps weeks separate. This tool reads it.

Are negative durations supported?

No, only positive durations.

Is my data stored?

Everything happens in your browser, and nothing you enter is sent anywhere.