ISO 8601 Duration Converter: Decode PT1H30M in Seconds
Parse ISO 8601 durations like PT1H30M into total seconds, minutes and human-readable text, or build valid duration strings from years down to seconds with a free 100% client-side converter.
Table of Contents
ISO 8601 Duration Converter: Decode PT1H30M in Seconds
ISO 8601 durations appear in YouTube links, calendar invites, media metadata, and API responses β and almost nobody reads them fluently. A string like PT1H30M looks like keyboard noise until you learn that it packs one hour and thirty minutes into six characters. Machines love the format because it is compact and unambiguous; humans were never meant to sight-read it. The free ISO 8601 Duration Converter closes that gap.
The format expresses an amount of time rather than a point in time. Instead of writing one hour and thirty minutes, systems write PT1H30M; instead of a two-week sprint, you see P14D. It appears in the iCalendar standard, the YouTube Data API, billing engines, and config files that control timeouts.
This guide explains how the grammar works, why a simple-looking string like P1M hides real ambiguity, and how to convert between duration strings and plain totals β entirely in your browser.
Why Use the ISO 8601 Duration Converter?
Two-way conversion. Parse durations into totals, or enter amounts from years down to seconds and get a valid duration string back.
Instant multiple readouts. Paste PT1H30M and see total seconds, total minutes, and human-readable text at once.
Full grammar support. Handles the complete PnYnMnDTnHnMnS structure, decimals on the smallest component, week forms like P3W, and the zero duration PT0S.
100% client-side privacy. Every calculation runs locally; nothing you paste ever leaves your machine.
Instant validation. Malformed input is flagged immediately, so you learn the grammar while you work.
Free and unlimited. No sign-up, no quotas β open the tab, convert, close it.
Key Features
| Feature | What It Does |
|---|---|
| Duration parser | Extracts every component from strings like PT1H30M or P2W |
| Component builder | Turns amounts from years down to seconds into a valid duration string |
| Total readouts | Shows the same duration as total seconds and total minutes |
| Human-readable text | Renders plain phrasing such as one hour, thirty minutes for UI copy |
| Live validation | Flags malformed strings and points at the broken part of the grammar |
| Client-side engine | All parsing and formatting happen locally with no network requests |
- The parser and builder share one live interface, so editing either side updates the other instantly.
- Week-based forms such as P3W are accepted even though they mix awkwardly with the rest of the grammar.
How to Use
- Open the converter. Navigate to the ISO 8601 Duration Converter. Nothing to install.
- Paste a duration. Enter any ISO 8601 duration, for example PT1H30M, into the parse field.
- Read the totals. Instantly see 5,400 total seconds, 90 total minutes, and the human-readable text.
- Or build a duration. Enter component amounts β say 1 year and 2 hours β and the builder generates P1YT2H.
- Copy the result. Take the duration string, the seconds, or the readable text into your payload or config file.
Reading the Duration Grammar
Once you see the structure, ISO 8601 durations stop looking like noise and start looking like a tidy little language.
The P designator. Every duration begins with P, for period, so it can never be confused with a date. A string starting with P describes an amount of time, not a moment on the calendar.
Date part versus time part. After the P come date components β years (Y), months (M), days (D) β and, when a time portion exists, the letter T separates them from hours (H), minutes (M), and seconds (S). The T is not decoration: P1M means one month while PT1M means one minute. The same letter means month before the T and minute after it, which causes most hand-written duration bugs.
Order matters. Components always run from largest to smallest. Pieces may be omitted β they are simply zero β but they cannot be rearranged or repeated.
Decimals on the smallest component. A fraction is allowed, but only on the smallest unit present. PT1.5H legally means ninety minutes, while PT1.5H30M does not.
Why months are ambiguous. A duration containing months or years has no fixed length in seconds. P1M starting on January 1 spans 31 days; starting on February 1 it spans 28. P1Y is 365 days one year and 366 the next. The standard keeps these units calendar-aware so that one month from now matches human expectations, so flattening them into seconds requires a fixed-length convention or a reference date.
Worked examples.
- PT1H30M β one hour plus thirty minutes: 3,600 + 1,800 = 5,400 seconds, or 90 minutes.
- P1YT2H β one year plus two hours; the time part survives even with empty month and day slots.
- PT0S β the zero duration, the shortest legal string, used by APIs to mean no elapsed time.
Where these strings appear. The YouTube Data API returns video lengths as durations such as PT4M13S, even though share links use a t= parameter counted in seconds. RFC 5545 stores calendar event lengths and reminder offsets as durations like PT15M, and media tools report chapter lengths the same way.
Practical Use Cases
Video Timestamps and Media Metadata
Video durations from the YouTube Data API or from file metadata arrive as PT4M13S-style strings. Convert them to seconds to sort a playlist, total watch time, or format timestamps for your own UI.
Calendar and Event Apps
RFC 5545 expresses meeting lengths and reminder offsets as durations. Use the builder to turn forty-five minutes into a compliant PT45M before generating invites, and parse incoming invites to see what they contain.
Subscription Billing Periods
Billing engines encode plan cycles as P1M, P3M, or P1Y. Paste those strings into the converter to see what each cycle means in days and to catch the month-length ambiguity before it hits an invoice.
CI Timeout Configurations
Some platforms accept durations in configuration while others want plain seconds. Converting PT10M to 600 seconds verifies that a job timeout in one system matches its counterpart in another.
Best Practices
- Prefer the fewest components that express the value; PT90M and PT1H30M are equivalent, so match the surrounding convention.
- Watch the T whenever minutes are involved β P1M and PT1M differ by a factor of roughly 43,000.
- Allow decimals only on the smallest component, or normalize the value first.
- Treat month and year durations as calendar-aware and never convert them to seconds without a reference date.
- Validate third-party durations instead of trusting them; a stray P1M where PT1M was meant is a classic bug.
- For elapsed time between two clock times, pair this tool with the Time Duration Calculator.
If you have ever squinted at PT1H30M and reached for a calculator, stop. Open the free ISO 8601 Duration Converter, paste the string, and get total seconds, total minutes, and readable text in one glance β with no byte leaving your browser.
Related Tools You Might Like:
- Date Format Converter β translate dates between ISO 8601, RFC 2822 and Unix timestamps.
- Week Number Calculator β find the ISO week number for any date in the year.
- Time Duration Calculator β measure elapsed time between two clock times down to the second.
Happy converting β may all your durations parse on the first try!
Frequently Asked Questions
Q: What does PT1H30M mean in plain English?
A: One hour and thirty minutes. The P marks the string as a duration, the T starts the time portion, 1H is the hour, and 30M is thirty minutes β 5,400 seconds in total.
Q: Why do the letters M and T matter so much?
A: M means months before the T and minutes after it. Writing P1M when you meant PT1M turns one minute into one month.
Q: How many seconds is P1M?
A: There is no single answer: a month spans 28 to 31 days depending on where it starts, so a converter must assume a fixed length or use a reference date. Durations built only from hours, minutes and seconds always have exact totals.
Q: Is PT0S a valid duration?
A: Yes. It is the zero duration β zero seconds β and the shortest legal ISO 8601 duration, often used as a placeholder for no time elapsed.
Q: Does the converter send my data anywhere?
A: No. All parsing and building run entirely in your browser; nothing you type is uploaded or stored.