Duration Formatter

Format seconds or milliseconds as readable durations.

Open tool

Overview

The Duration Formatter takes a raw number of seconds (or milliseconds) and renders it as a human-readable phrase like "2 days 4 hours 12 minutes" or "01:23:45". Paste a numeric duration and the tool emits several common formats at once — colon-separated, compact, long-form, and ISO 8601 — so you can copy the variant that matches your downstream system.

Useful for log analysts converting elapsed-millisecond fields into friendly columns, video editors translating frame counts into runtime, Pomodoro and timer dashboards, and developers building progress bars or "estimated time remaining" labels for user-facing apps.

How it works

The seconds value is decomposed into days, hours, minutes, and seconds using simple modular arithmetic against the constants 86,400, 3,600, and 60. Sub-second components are pulled from the fractional part when milliseconds are supplied. The ISO 8601 format follows the PnDTnHnMnS grammar used by the duration tool elsewhere in this category, and the colon-separated format follows the SMPTE-style HH:MM:SS.fff convention familiar from video and audio editing.

Because the underlying value is a count of fixed-length seconds, there are no calendar-aware month or year components — those require a start date to make sense. For human ages and "X years ago" phrases, use the date-difference or relative-time tools.

Examples

3725 seconds
→ 01:02:05
→ 1 hour 2 minutes 5 seconds
→ PT1H2M5S

90061.234 seconds
→ 1 day 01:01:01.234
→ P1DT1H1M1.234S

45 seconds
→ 00:00:45
→ 45 seconds

FAQ

Should I enter seconds or milliseconds?

Both are accepted. Values larger than about 10^10 are assumed to be milliseconds (matching JavaScript's Date.now() scale) and others as seconds — toggle the unit if the heuristic guesses wrong.

Why is there no "month" component?

A month has variable length (28–31 days), so a fixed-length duration cannot be split into months without a calendar reference point. The ISO 8601 spec distinguishes "period" (calendar-aware) from "duration" (fixed-length) for this reason.

What is the ISO 8601 form?

A canonical string like P3DT2H meaning "3 days, 2 hours." It is the format used by the JSON serializer in many languages and by HTML <time> elements for machine-readable durations.

Does it handle negative durations?

Yes — the long-form prefix becomes "minus" and the ISO form is wrapped in a leading minus sign (-P1H), which is the official negative-duration form in the ISO 8601 amendments.

Can it parse a formatted string back to seconds?

Use the ISO 8601 duration parser for round-tripping. This tool is one-way (number → text) by design.

Try Duration Formatter

An unhandled error has occurred. Reload ×