Milliseconds or seconds into 2d 3h 5m 10s, 2 days 3 hours, and 3 hours ago, bilingual, copy in one click, browser-only
- Runs locally
- Category Developer & DevOps
- Best for Formatting, validating, shrinking, or inspecting code-adjacent text.
Human-readable
As relative time
Breakdown
What this tool does
Turn a raw duration number into the phrase a human actually reads. Paste a millisecond or second value from a log line, a Date.now() delta, a setTimeout, a video length or an API field, and this tool renders it as a readable string: short like 2d 3h 5m 10s, medium like 2 d 3 h 5 m 10 s, or long like 2 days, 3 hours, 5 minutes, 10 seconds. Cap how many units show with maxUnits so a six-day job reads as 6 days, not six trailing zeros, and set the smallest unit so timings round off at seconds or minutes instead of dripping milliseconds. A second reading turns the same magnitude into relative time, so a negative delta becomes 3 hours ago and a positive one becomes in 3 hours. Everything runs in your browser, both Chinese and English are written natively, and one click copies the result. This is presentation, not unit conversion, so for milliseconds to hours math reach for the duration converter instead.
Tool details
- Input
- Files + Numbers
- The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
- Output
- Live result + Copy
- The result area focuses on usable output, with copy, download, or preview actions when supported.
- Privacy
- Browser-side processing
- The main tool logic does not call an external API, so inputs normally stay in the current tab.
- Save / share
- Shareable URL state
- Key settings are encoded in the URL so another person can reopen the same setup.
- Performance budget
- Initial JS <= 9 KB
- No WASM budget is declared, keeping the tool quick to open on mobile.
- Best fit
- Developer & DevOps · Developer
- Category and role tags drive related tools, internal links, and quick fit checks.
How to use
-
1. Input
Paste or drop your content into the tool panel.
-
2. Process
Click the button. All processing is local in your browser.
-
3. Copy / Download
Copy the result or download to disk in one click.
How Duration Humanizer fits into your work
Use it in the small gaps between coding, reviewing, debugging, and shipping.
Developer jobs
- Formatting, validating, shrinking, or inspecting code-adjacent text.
- Preparing snippets for documentation, tickets, commits, or handoff.
- Checking a small payload quickly without switching tools.
Developer checks
- Run irreversible transforms like minify or obfuscate on a copy.
- Keep secrets out of pasted snippets unless the tool explicitly stays local.
- Use your normal tests or linter before shipping transformed code.
Good next steps
These links move the current task into a more complete workflow.
- 1 Duration Converter Seconds ⇄ minutes ⇄ hours ⇄ days ⇄ weeks, plus human-readable, ISO 8601 duration and HH:MM:SS — one input, every format — browser-only Open
- 2 Time Duration Calculator Hours between two times, add or subtract time, and add up a timesheet — decimal hours + pay — browser-only Open
- 3 Unix Timestamp Converter Unix timestamp ⇄ human date — seconds / milliseconds / ISO 8601 — UTC and local — browser-only Open
Real-world use cases
Label log timings without mental math
Your service logs a request took 90061 ms and a job ran for 5400000 ms. Raw, those numbers are noise. Paste each one in and read 1 m 30 s 61 ms and 1 h 30 m, so the slow path is obvious at a glance. Set the smallest unit to seconds when the millisecond tail is just jitter, and the timings line up clean in your incident notes.
Show a friendly time-ago on a feed
You store posts with a Unix timestamp and want each card to say how old it is. Subtract the saved time from now, drop the millisecond delta into the relative reading, and it returns 3 hours ago or 2 days ago using the single largest unit. Copy the phrasing into your component and the feed reads like every app a user already knows.
Turn a setTimeout or TTL into copy a human approves
A cache TTL is set to 604800 seconds and a retry backoff to 90000 ms. Before you put either in a settings screen or a tooltip, humanize them: 7 days and 1 m 30 s. Switch to the long format for the user-facing string, 7 days reads far better in a sentence than a six-digit second count nobody can parse on sight.
Sanity-check whether a value is ms or seconds
A teammate hands you 86400 and you are not sure of the unit. Read it as milliseconds and it is 1 m 26 s 400 ms, read it as seconds and it is exactly 1 day. The day-on-the-nose result tells you the field was seconds. Flipping the unit toggle and watching the phrase change is faster than dividing by 1000 in your head.
Common pitfalls
Feeding seconds while the unit is left on milliseconds. A 3600 that should be one hour prints as 3 s 600 ms, off by a factor of a thousand. Most JavaScript deltas are ms and most Unix timestamps are seconds, so confirm the source and set the toggle before you trust the phrase.
Expecting maxUnits to round. It only truncates from the largest unit down. With maxUnits 1 a value of 1d 23h shows 1d, not 2d, because the 23 hours are dropped rather than rounded up. Reach for a real rounding step first if you need the nearest day.
Confusing the smallest-unit floor with maxUnits. The floor drops everything below a chosen unit from the bottom, while maxUnits caps the count from the top. Setting the floor to minutes on a sub-minute value gives an empty result that falls back to 0 minutes, which surprises people who expected the seconds to survive.
Privacy
Every step here runs as plain JavaScript inside your browser tab: the breakdown into days, hours, minutes, seconds and milliseconds, the short, medium and long formatting, and the relative-time reading. The number you type never leaves the page and nothing is logged. The one caveat is the shareable URL, which encodes your value and style options in the query string, so a link pasted into chat records that number in the recipient server access log. If the duration reveals something sensitive, use the copy button and paste the text rather than sharing the URL.
FAQ
Tool combos
Folks in your role tend to reach for these alongside this tool.
- Add Line Numbers Number every line of pasted text — set start, step and separator, zero-pad to align, skip blanks, or strip numbers back off — browser-only
- AES Text Encryptor Encrypt & decrypt text with a password — AES-256-GCM + PBKDF2 via WebCrypto — 100% in your browser, nothing uploaded
- Affine Cipher Encoder & Decoder Encrypt and decrypt the ax+b affine cipher with live modular-inverse check, browser-only
- Age Difference Calculator The exact gap between two birthdays — years/months/days, percentage, and the date one person is twice the other's age — browser-only