Duration Humanizer

Convert a number of seconds into a 2 hours, 34 minutes form

Turn a raw duration in seconds into a clear, human-readable string like 2 hours, 34 minutes. Breaks the total into years, months, weeks, days, hours, minutes, and seconds with control over how many parts to show. Runs in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How long is a month in this tool?

A month is treated as 30.4375 days, which is exactly one twelfth of a 365.25-day year. This average keeps long durations accurate without needing a specific calendar start date.

This tool converts a plain number of seconds into a readable phrase such as 2 hours, 34 minutes, 56 seconds. It is handy for displaying job runtimes, video lengths, cache ages, or any elapsed-time value that would otherwise be an opaque integer.

When a raw second count is unhelpful

Durations expressed as raw integers are common in data systems but nearly impossible to parse at a glance:

  • A video file metadata field saying duration: 9256 tells a human nothing without arithmetic.
  • A CI/CD pipeline reporting buildTime: 7382 seconds is less useful than “2 hours, 3 minutes, 2 seconds”.
  • A cache TTL of 2592000 becomes “30 days” — a value a non-developer can reason about.
  • An uptime counter at 31536000 is immediately recognisable as “1 year”.

The humanizer solves the translation problem once so you can paste the result into emails, documentation, UI labels, or any context where a raw integer would confuse a reader.

How it works

The total is divided down through a fixed table of units, from largest to smallest, taking the whole-number quotient at each step and carrying the remainder forward:

years   = floor(total / 31557600)   ; 365.25 days
months  = floor(rem  / 2629800)     ; year / 12
weeks   = floor(rem  / 604800)      ; optional
days    = floor(rem  / 86400)
hours   = floor(rem  / 3600)
minutes = floor(rem  / 60)
seconds = rem

Only units with a non-zero value are shown, and the list is truncated to the maximum number of parts you choose. Because the higher units use average lengths (365.25 days per year), the result stays accurate over long spans without anchoring to a calendar.

Example and tips

9296 seconds becomes 2 hours, 34 minutes, 56 seconds, or 2 hours, 34 minutes if you cap the output at two parts. For a friendly summary on a dashboard, keep the maximum at 2 or 3 parts; for an exact breakdown, raise it to 7. The minus sign on negative inputs lets you reuse the same tool for both countdowns and elapsed time.

Choosing the number of parts

The “max parts” setting controls how precise versus how readable the output is:

Max partsExample output for 9,296 sGood for
12 hoursHigh-level dashboards, status pages
22 hours, 34 minutesMost UI labels and notifications
32 hours, 34 minutes, 56 secondsLog entries, time-tracking reports
72 hours, 34 minutes, 56 secondsComplete breakdown (rarely needed)

Leading units with a zero value are omitted automatically. A duration of 45 seconds shows as 45 seconds at max-parts 2, not 0 hours, 0 minutes, 45 seconds.

Including or excluding weeks

Weeks are optional because they sit awkwardly between days and months in everyday language. Most English speakers think in “days” rather than “weeks” for durations under a month, and “months” rather than “weeks” for durations over three weeks. Turn weeks on when you specifically need to express durations like “3 weeks, 2 days” rather than “23 days” — common in project scheduling contexts where weekly sprints are meaningful.