Skip to content
ZeroServer.tools

Seconds to Time Converter

Convert seconds to hours, minutes, and seconds (HH:MM:SS). Also shows days. Works in both directions: HH:MM:SS back to total seconds.

About Seconds to Time Converter

Converting between seconds and HH:MM:SS format is a common need for developers, video editors, athletes, and project managers. This tool works in both directions: enter a number of seconds to get the formatted time, or enter hours, minutes, and seconds to get the total seconds. Common reference points: 60 seconds = 1 minute, 3,600 seconds = 1 hour, 86,400 seconds = 1 day, 604,800 seconds = 1 week.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Turning a duration in seconds from a log or a benchmark into hours, minutes and seconds.
  • Converting a video length or a timeout value into readable form.
  • Working the other way to produce a total-seconds value for a config field.
  • Checking a long uptime figure in days as well as hours.
  • Comparing two durations recorded in different units.

Frequently Asked Questions

How is the conversion done?
Integer division and remainder: hours = total ÷ 3600, minutes = (total mod 3600) ÷ 60, seconds = total mod 60. Each part needs zero-padding to two digits, or 1:5:3 appears instead of 01:05:03.
What happens beyond 24 hours?
A DURATION keeps counting — 100,000 seconds is 27:46:40, not 03:46:40. Wrapping at 24 is correct for a clock time and wrong for an elapsed duration, and conflating the two silently loses a day.
How are negative values handled?
Format the absolute value and prefix a minus, so −90 seconds is −00:01:30. Applying the arithmetic directly to a negative gives nonsense, because remainder behaviour for negatives differs between languages.
What about fractional seconds?
They belong after a decimal point, not as a fourth colon-separated field — 01:05:03.250. Milliseconds are common in logs and media timestamps, where SMPTE timecode uses frames instead and is a different format.
Should hours be shown when zero?
Depends on context. Media players usually hide them for short clips (3:45 rather than 00:03:45) but must show them once the duration passes an hour. Fixed-width output is better for logs, where alignment matters.
Should hours roll over at 24 in a duration?
No — a duration of 30 hours is 30:00:00, not 06:00:00. Rolling over is correct for a clock time and wrong for an elapsed one, and conflating the two is the most common bug in this conversion.
How should the components be zero-padded?
Minutes and seconds always to two digits; hours only if a fixed width matters. `1:05:09` and `01:05:09` are both readable, but `1:5:9` is not — the padding on the smaller units is what keeps it parseable.
How does this relate to ISO 8601 durations?
The same value written as `PT1H5M9S`, which is unambiguous and sorts poorly. Colon notation is for reading; the ISO form is for interchange, where there is no doubt about which unit is which.

Common errors and gotchas

  • Confusing seconds with milliseconds, which is a factor of a thousand and very easy to miss.
  • Omitting the leading zero on minutes or seconds, which breaks alignment and sorting.
  • Rolling over incorrectly at 60, where 90 seconds is one minute thirty rather than one point three.
  • Losing the days component on a long duration, so a figure appears as an implausible hour count.
  • Reading a decimal-hours value as hours and minutes, where 2.5 is two and a half hours not two fifty.

Related Converters tools

Private & free — this tool runs entirely in your browser.

IndieKitShip your Next.js startup in days.affiliate