UTILS.
Private by default
⏱→

Seconds to Duration

Convert a number of seconds into a readable duration and parse a duration back to seconds.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →
— output appears here —
— output appears here —

About this tool

Two converters on one page: seconds to a readable duration, and a typed duration back to total seconds. Both update as you type and run in your browser.

In the first box enter a number of seconds. Commas, spaces and underscores are stripped, so 93,845 works, and decimals and negative numbers are allowed. The duration appears in compact form such as 1d 2h 4m 5s, leaving out zero units, with milliseconds kept. Under it three tiles show the same span as a total number of days, hours and minutes, rounded to three decimals. A negative input gets a minus sign in the duration and is shown as a positive amount in the tiles.

In the second box type a duration like 2d 3h 4m 5s. The units are d, h, m, s and ms, and each number may have a decimal part, as in 1.5h. The parts are added together and shown in seconds. A plain number with no unit is read as seconds.

A day is exactly 86,400 seconds, with no calendar months, years or daylight-saving changes. The reader is lenient and skips text it does not recognise, and a leading minus sign in the second box makes the whole total negative, as in -1h 30m. Nothing leaves your device.

Frequently asked questions

What duration format does it accept?
A string like 2d 3h 4m 5s using d, h, m, s and ms. Any units may be left out, decimals such as 1.5h work, and a plain number is read as seconds.
How long is a day here?
Exactly 24 hours, or 86,400 seconds. Months, years and daylight-saving shifts are not included.
Can I enter a negative duration?
In the seconds box, yes: the result gets a minus sign. In the duration box, a leading minus negates the whole total, so -1h 30m gives -5,400 s.
Why do the day, hour and minute tiles show decimals?
Each tile shows the whole span in that single unit, so 90 seconds is 1.5 minutes. The compact line above splits it into whole units instead.

More tools