How to convert seconds to hours:minutes:seconds
✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)Display a raw seconds count (from a log, timer, or export) as readable hh:mm:ss.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel (desktop) | =TEXT(A2/86400,"hh:mm:ss") | Or =A2/86400 with the cell formatted as [h]:mm:ss to keep it numeric. |
| Google Sheets | =TEXT(A2/86400,"hh:mm:ss") | Identical. |
| LibreOffice Calc | =TEXT(A2/86400,"HH:MM:SS") | Format codes are case-insensitive here; "hh:mm:ss" also works. |
How it works
Spreadsheets store time as a fraction of a day, so dividing seconds by 86,400 (seconds per day) converts the count into a time value; TEXT then formats it. 3,725 seconds is 1 hour, 2 minutes, 5 seconds. If a duration might exceed 24 hours, format the cell as [h]:mm:ss instead of using TEXT — the bracketed [h] stops hours wrapping around at 24.
Verified, not just documented
We ran =TEXT(A2/86400,"HH:MM:SS") in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 01:02:05 — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned 01:02:05 for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.
Functions used
TEXT — see full Excel, Google Sheets & LibreOffice compatibility for each.
Related recipes
- How to abbreviate large numbers as K and M
- How to add leading zeros to a number
- How to concatenate a date with text (without getting a number)
- How to convert 12-hour text times to 24-hour
- How to convert a date to text