⏱️ Time Duration Calculator
By ToolNimba Editorial Team · Updated 2026-06-19
This time duration calculator works out how much time passes between a start time and an end time. Type the two times in either 12-hour form (such as 9:15 AM) or 24-hour form (such as 17:45), and you get the gap shown three ways: as hours and minutes, as decimal hours, and as total minutes. It handles shifts that run past midnight, so a clock-in at 10:00 PM and a clock-out at 6:00 AM reads as 8 hours, not a negative number.
What is the Time Duration Calculator?
Finding the duration between two clock times sounds simple, but the everyday mix of AM and PM, the jump from 12 to 1, and shifts that cross midnight trip people up constantly. The reliable method is to convert each time into a single running count, minutes since midnight, do the arithmetic there, then convert the answer back into hours and minutes. Working in minutes removes the base-60 confusion: 9:15 AM is 555 minutes after midnight, 5:45 PM is 1065 minutes, and the gap is simply 1065 minus 555, which is 510 minutes, or 8 hours and 30 minutes.
The one case that needs care is when the end time is earlier on the clock than the start time. That normally means the period ran overnight, for example a night shift from 10:30 PM to 6:15 AM. Subtracting directly gives a negative number, so you add 24 hours (1440 minutes) to the end time before subtracting. The calculator does this automatically when the overnight option is ticked, turning what looks like minus 975 minutes into a correct 465 minutes, or 7 hours and 45 minutes.
Decimal hours matter whenever the duration feeds into money or a spreadsheet. Payroll, freelance invoices and timesheets are usually paid by the hour, so 8 hours and 30 minutes has to become 8.5 hours before you multiply by a rate. The conversion is just the minutes divided by 60: 30 minutes is 0.5, 15 minutes is 0.25, and 45 minutes is 0.75. Knowing those quarter-hour anchors lets you sanity-check the decimal output at a glance.
When to use it
- Adding up hours worked on a shift or timesheet, including shifts that run past midnight.
- Converting a worked period into decimal hours to bill a client or run payroll.
- Measuring how long a task, meeting, cook time, or workout actually took.
- Checking the length of a flight, journey, or appointment booked across two clock times.
How to use the Time Duration Calculator
- Enter the start time, in 12-hour form like 9:15 AM or 24-hour form like 09:15.
- Enter the end time in the same way.
- Leave the overnight box ticked if the period can run past midnight; untick it to flag a backwards entry as an error instead.
- Read off the duration as hours and minutes, decimal hours, and total minutes.
Formula & method
Worked examples
A day shift from 9:15 AM to 5:45 PM.
- Start: 9:15 AM = 9 × 60 + 15 = 555 minutes after midnight
- End: 5:45 PM = 17:45 = 17 × 60 + 45 = 1065 minutes after midnight
- Duration = 1065 − 555 = 510 minutes
- 510 minutes = 8 hours and 30 minutes (510 ÷ 60 = 8 remainder 30)
- Decimal hours = 510 ÷ 60 = 8.5
Result: 8 h 30 min, which is 8.5 decimal hours or 510 minutes
A night shift from 10:30 PM to 6:15 AM, crossing midnight.
- Start: 10:30 PM = 22:30 = 22 × 60 + 30 = 1350 minutes
- End: 6:15 AM = 6 × 60 + 15 = 375 minutes
- Raw difference = 375 − 1350 = −975 minutes (negative, so the period is overnight)
- Add 24 hours: 375 + 1440 = 1815 minutes for the end
- Duration = 1815 − 1350 = 465 minutes
- 465 minutes = 7 hours and 45 minutes; decimal hours = 465 ÷ 60 = 7.75
Result: 7 h 45 min, which is 7.75 decimal hours or 465 minutes
Worked durations between two times
| Start | End | Hours and minutes | Decimal hours |
|---|---|---|---|
| 9:00 AM | 5:30 PM | 8 h 30 min | 8.5 |
| 8:00 AM | 4:30 PM | 8 h 30 min | 8.5 |
| 11:00 PM | 7:00 AM | 8 h 0 min | 8.0 |
| 9:00 AM | 12:30 PM | 3 h 30 min | 3.5 |
| 2:00 PM | 2:45 PM | 0 h 45 min | 0.75 |
Minutes to decimal hours for common quarter-hour points
| Minutes | Decimal hours |
|---|---|
| 15 min | 0.25 |
| 30 min | 0.5 |
| 45 min | 0.75 |
| 60 min | 1.0 |
Common mistakes to avoid
- Forgetting to add 24 hours for an overnight period. If the end time is earlier on the clock than the start, a plain subtraction gives a negative duration. For a period that ran past midnight you must add 24 hours to the end before subtracting, which this tool does when the overnight box is ticked.
- Mixing up 12 AM and 12 PM. 12:00 AM is midnight (the start of the day, 00:00) and 12:00 PM is noon (12:00). Swapping them shifts the result by 12 hours, so double-check the AM or PM on any time near twelve.
- Treating minutes like decimals. 8 hours and 30 minutes is 8.5 hours, not 8.3. Minutes run from 0 to 59, so to get decimal hours you divide the minutes by 60, never just move the decimal point.
- Reading 24-hour times as 12-hour. In 24-hour form 17:45 means 5:45 PM, not 17 minutes past something. If you enter a value above 12 without AM or PM, the calculator reads it as 24-hour time.
Glossary
- Duration
- The amount of time that passes between a start time and an end time.
- Decimal hours
- A duration written as a single number where the fractional part is minutes divided by 60, so 90 minutes is 1.5 hours.
- 24-hour time
- A clock that runs from 00:00 to 23:59 without AM or PM, where 13:00 is 1:00 PM.
- Minutes since midnight
- A clock time expressed as a single count of minutes from 00:00, used to subtract two times reliably.
- Overnight period
- A span whose end time falls on the next calendar day, so the end clock time is earlier than the start.
Frequently asked questions
How do I calculate the time between two times?
Convert each time to minutes since midnight, subtract the start from the end, then turn the result back into hours and minutes. For example 9:15 AM is 555 minutes and 5:45 PM is 1065 minutes, so the gap is 510 minutes, which is 8 hours and 30 minutes. The calculator does this for you.
How does it handle times that cross midnight?
When the end time is earlier on the clock than the start, the tool assumes the period ran overnight and adds 24 hours to the end before subtracting. So 10:30 PM to 6:15 AM correctly returns 7 hours and 45 minutes. Untick the overnight box if you would rather flag a backwards entry as an error.
Can I enter times in 24-hour format?
Yes. Type either 12-hour times with AM or PM, such as 5:45 PM, or 24-hour times, such as 17:45. Both produce the same answer. A value above 12 with no AM or PM is read as 24-hour time.
What are decimal hours and why do they matter?
Decimal hours express a duration as one number, with the minutes shown as a fraction of an hour: 30 minutes is 0.5, 15 minutes is 0.25, 45 minutes is 0.75. Payroll, timesheets and invoices are usually paid by the hour, so you multiply the rate by decimal hours rather than by hours and minutes.
Is 8 hours 30 minutes the same as 8.3 hours?
No. 30 minutes is half an hour, so 8 hours 30 minutes is 8.5 hours. To convert minutes to a decimal you divide by 60 (30 ÷ 60 = 0.5), you do not just place the minutes after a decimal point.
Does the calculator include seconds?
No, it works to the minute, which is what timesheets, shifts and most appointments use. Enter times as hours and minutes and you get the duration in hours, minutes, decimal hours and total minutes.