Convert Seconds to Time (hh:mm:ss) in Excel
By ExcelReady TeamUpdated 6 min read
The short answer
Divide the seconds by 86400, the number of seconds in a day, then format the cell as [h]:mm:ss. For example, =A2/86400 turns 3725 into 1:02:05. To get text instead of a time value, use =TEXT(A2/86400,"[h]:mm:ss"). The square brackets around h let the hours go past 24.
Key takeaways
- Excel stores time as a fraction of a day, so seconds divided by 86400 give a time value.
- Format the result as [h]:mm:ss. Without the brackets, hours reset to 0 every 24 hours.
- =TEXT(A2/86400,"[h]:mm:ss") returns the same result as text, ready to join with other words.
- To go back from a time to seconds, multiply by 86400.
- Avoid TIME(0,0,A2) for big numbers: its seconds argument stops at 32767, and the result wraps after 24 hours.
On this page+
- Why you divide seconds by 86400
- How to convert seconds to hh:mm:ss with a format
- Why you need [h] for more than 24 hours
- How to convert seconds to time as text with TEXT
- Show days, hours, minutes and seconds
- Seconds stored as text, decimals and milliseconds
- Common mistakes when converting seconds to time
- Practise it
To convert seconds to time in Excel, divide the number of seconds by 86400 and format the result as [h]:mm:ss. So 3,725 seconds becomes 1:02:05, and 95,000 seconds becomes 26:23:20. This guide is for anyone who gets durations as raw seconds, from call logs, video lengths, app exports or race results, and needs to read them as hours, minutes and seconds.
Why you divide seconds by 86400#
Excel stores dates and times as numbers, where 1 means one whole day. Noon is 0.5, because it is half a day. A time is just a fraction of 1.
A day has 24 × 60 × 60 = 86,400 seconds. So to turn seconds into Excel's time scale, divide by 86400:
=A2/86400If A2 holds 3725, the result is about 0.0431, which is 0.0431 of a day. It looks like a meaningless decimal until you give it a time format. The guide to how Excel stores times explains the same idea for subtracting two times.
How to convert seconds to hh:mm:ss with a format#
A number format changes how a value looks without changing the value. Here are the steps:
- In B2, type
=A2/86400and fill it down (Windows: Ctrl+D; Mac: ⌘D). - Select the results and open Format Cells (Windows: Ctrl+1; Mac: ⌘1).
- Choose Custom and type
[h]:mm:ssin the Type box. - Click OK.
| A | B | |
|---|---|---|
| 1 | Seconds | Duration |
| 2 | 3,725 | 1:02:05 |
| 3 | 95,000 | 26:23:20 |
| 4 | 45 | 0:00:45 |
The value in B2 is still a number, so you can add, average or chart it. That is the main reason to prefer a format over text. For example, =SUM(B2:B4) with the same [h]:mm:ss format shows the total time of all three rows, 27:26:10, and =AVERAGE(B2:B4) shows the average duration. An average of 9:08:43 is easier to read than an average of 32,923.33 seconds, and it is the same value. For more format codes, see custom number formats in Excel.
Why you need [h] for more than 24 hours#
Square brackets around the hours code show the total hours instead of the hours of the day. Without them, Excel treats each full 24 hours as a day and hides it.
| Seconds | h:mm:ss shows | [h]:mm:ss shows |
|---|---|---|
| 3,725 | 1:02:05 | 1:02:05 |
| 95,000 | 2:23:20 | 26:23:20 |
95,000 seconds is 26 hours, 23 minutes and 20 seconds. The plain h format drops one full day and shows 2:23:20, which is wrong for a duration. Use [h] for any total that might pass a day. The same rule applies when you add hours to a time and the total runs past midnight.
Brackets work on minutes and seconds too. [m]:ss shows total minutes: 3,725 seconds becomes 62:05. [s] shows total seconds.
How to convert seconds to time as text with TEXT#
The TEXT function applies a number format inside a formula and returns text. Use it when you want to join the duration with words or export it as it looks:
=TEXT(A3/86400,"[h]:mm:ss")This returns 26:23:20 as text. You can then build a sentence:
="Call length: "&TEXT(A2/86400,"[h]:mm:ss")That gives "Call length: 1:02:05". The catch is that text can't be added or averaged, so keep a numeric version for calculations. The TEXT function guide and the article on TEXT function format codes list the codes you can use.
Show days, hours, minutes and seconds#
For long durations, you may want days shown on their own. Split the seconds with INT and MOD:
=INT(A3/86400)&"d "&TEXT(MOD(A3,86400)/86400,"hh:mm:ss")For 95,000 seconds this returns 1d 02:23:20.
INT(A3/86400)counts the full days: 1.MOD(A3,86400)is what is left after removing full days: 8,600 seconds.- TEXT formats those 8,600 seconds as 02:23:20.
You can also build hours, minutes and seconds by hand, which works in any tool that lacks time formats:
=INT(A3/3600)&":"&TEXT(INT(MOD(A3,3600)/60),"00")&":"&TEXT(MOD(A3,60),"00")This also returns 26:23:20. The guide to MOD and INT explains how these two split a number into whole parts and remainders.
Seconds stored as text, decimals and milliseconds#
Imported data often arrives in awkward shapes. Here is how to handle the common ones:
- Seconds stored as text. A value like '4500 sits on the left of the cell. Arithmetic usually converts it, so
=A5/86400still works, but you can make it explicit with=VALUE(A5)/86400. Either way, 4,500 seconds is 1:15:00. - Decimal seconds. For 3725.6 seconds, use the format
[h]:mm:ss.0to show tenths of a second. - Milliseconds. Divide by 86,400,000 instead:
=A2/86400000, then format as[h]:mm:ss.000. - Minutes, not seconds. Divide by 1440, the number of minutes in a day.
Common mistakes when converting seconds to time#
Most wrong results come from the format, not the formula. Check these:
- A long decimal shows instead of a time. The cell still has the General format. Apply
[h]:mm:ss. - Hours reset after 24. You used
hinstead of[h]. - You divided by 60 or 3600. That gives minutes or hours as a plain number, not a time value. Formatting it as time then shows nonsense.
- TIME(0,0,A2) fails. TIME's seconds argument can't go above 32,767, so larger values return #NUM!, and its result wraps back to 0 after 24 hours. Dividing by 86400 has neither problem.
- A SUM of text durations returns 0. Durations made with TEXT are text. Add the numeric versions instead, then format the total:
=TEXT(SUM(A2:A4)/86400,"[h]:mm:ss")gives 27:26:10 for the three rows above.
To go the other way, from a time back to seconds, multiply by 86400. A cell holding 1:02:05 times 86400 gives 3725.
Practise it#
Converting seconds is really two skills: knowing that Excel stores time as part of a day, and controlling how a number looks. Practise how Excel stores dates as numbers in a live spreadsheet, then practise TEXT and VALUE to switch between numbers and text. ExcelReady checks each formula as you type. Start with the 95,000-second exercise on this page.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Cell A3 holds 95,000 seconds. Click B3 and use TEXT to show it as hours, minutes and seconds, with hours allowed past 24. Press Enter.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Duration | |||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 | ||||
| 6 | ||||
| 7 |
Tip: Divide A3 by 86400 to turn it into a fraction of a day, then use the format code "[h]:mm:ss". The brackets let the hours pass 24.
Practise this in a lesson
Frequently asked questions
How do I convert seconds to hh:mm:ss in Excel?
Use =A2/86400 and format the cell as [h]:mm:ss with Format Cells (Ctrl+1, or Cmd+1 on a Mac). For text output, use =TEXT(A2/86400,"[h]:mm:ss").
Why divide by 86400?
A day has 24 x 60 x 60 = 86,400 seconds, and Excel stores one day as the number 1. Dividing by 86400 turns a count of seconds into a fraction of a day, which is how Excel stores time.
How do I show more than 24 hours?
Put the hours code in square brackets: [h]:mm:ss. With plain h:mm:ss, 95,000 seconds shows as 2:23:20 instead of 26:23:20, because Excel drops the full day.
How do I convert seconds to minutes and seconds only?
Use the format [m]:ss, or =TEXT(A2/86400,"[m]:ss"). For 3,725 seconds this shows 62:05, which is 62 minutes and 5 seconds.
How do I convert a time back to seconds?
Multiply the time by 86400 and format the result as a number. A cell holding 1:02:05 times 86400 gives 3725.