โฑ๏ธ Time Duration Calculator: Hours Between Two Times
By ToolNimba Editorial Team ยท Updated 2026-06-20
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.
The reason clock arithmetic feels harder than ordinary subtraction is that time is not base ten. Hours roll over every 60 minutes and the day rolls over every 24 hours, so you cannot simply subtract the digits the way you would with money. A start of 8:50 and an end of 9:10 is 20 minutes, not the 60-minute gap a careless digit subtraction (9 minus 8, then 10 minus 50) might suggest. Converting both times to a single minutes-since-midnight count sidesteps every carry and borrow, which is exactly why payroll systems, spreadsheets and this tool all do the same thing under the hood.
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, and the reference tables below give you the full minute-by-minute breakdown.
Time cards add two extra steps that pure duration leaves out: unpaid breaks and rounding. To turn raw clock-in and clock-out times into paid hours, you first find the duration, then subtract any unpaid lunch or break minutes, and only then convert to decimal hours for pay. Many employers also round each punch to the nearest 5, 6 or 15 minutes. Under United States federal law (the FLSA) rounding is allowed as long as it is neutral over time and does not systematically shortchange the worker, and the common rule of thumb rounds to the nearest quarter hour using the 7-minute split: 1 to 7 minutes past a mark round down, 8 to 14 round up. This calculator reports the exact duration so you can apply your own break and rounding policy on top with confidence.
The same minutes-since-midnight method scales to anything measured by the clock, not just work. Cooking and baking times, interval workouts, study or focus sessions, parking and meter limits, flight and travel legs, and meeting lengths all reduce to the gap between two times. When a span crosses midnight or runs longer than a day, switch to a date and time tool so the calendar date is part of the calculation, but for same-day or single-overnight spans a clock-to-clock duration is all you need.
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, run payroll, or fill in a spreadsheet.
- Working out paid hours on a time card by finding the duration and then subtracting an unpaid lunch break.
- Measuring how long a task, meeting, cook time, study session, or workout actually took.
- Checking the length of a flight, commute, journey, or appointment booked across two clock times.
- Confirming a parking, meter, or rental window before a deadline so you do not run over.
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.
- For paid hours, subtract any unpaid break minutes from the result, then use the decimal hours figure to multiply by your rate.
Formula & method
Worked examples
A day shift from 9:15 AM to 5:45 PM.
- Start: 9:15 AM = 9 x 60 + 15 = 555 minutes after midnight
- End: 5:45 PM = 17:45 = 17 x 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 x 60 + 30 = 1350 minutes
- End: 6:15 AM = 6 x 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
A time card from 8:00 AM to 4:30 PM with an unpaid 30-minute lunch, paid at 18 dollars an hour.
- Start: 8:00 AM = 480 minutes; End: 4:30 PM = 16:30 = 990 minutes
- Duration = 990 - 480 = 510 minutes = 8 h 30 min
- Subtract the unpaid 30-minute lunch: 510 - 30 = 480 minutes of paid time
- 480 minutes = 8 hours and 0 minutes; decimal hours = 480 / 60 = 8.0
- Pay = 8.0 x 18 = 144 dollars
Result: 8 h 30 min on the clock, 8 h 0 min paid (8.0 decimal hours), 144 dollars at 18 per hour
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 |
| 7:30 AM | 3:45 PM | 8 h 15 min | 8.25 |
Minutes to decimal hours (every 5 minutes)
| Minutes | Decimal hours |
|---|---|
| 5 min | 0.08 |
| 10 min | 0.17 |
| 15 min | 0.25 |
| 20 min | 0.33 |
| 30 min | 0.50 |
| 40 min | 0.67 |
| 45 min | 0.75 |
| 50 min | 0.83 |
| 60 min | 1.00 |
Quarter-hour payroll rounding (nearest 15 minutes, 7-minute rule)
| Minutes past the mark | Rounds to | Direction |
|---|---|---|
| 1 to 7 min | 0 min (down to the mark) | Round down |
| 8 to 14 min | 15 min (up to next mark) | Round up |
| 16 to 22 min | 15 min | Round down |
| 23 to 29 min | 30 min | Round up |
| 38 to 44 min | 45 min | Round down (after 30 mark) |
| 53 to 59 min | 60 min (next hour) | Round up |
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.
- Forgetting to subtract unpaid breaks. The duration between clock-in and clock-out is total time on site, not paid time. If lunch or breaks are unpaid, subtract those minutes before converting to decimal hours, or you will overstate the hours owed.
- Rounding before the policy says to. Round only at the step your employer or client requires, usually the final punch or the daily total, and apply the same rule both ways. Rounding every intermediate figure compounds errors and can quietly shortchange the worker.
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.
- Elapsed time
- Another name for duration: the measured gap between a start and an end, regardless of the clock times involved.
- Payroll rounding
- Adjusting a clock punch to the nearest fixed interval, commonly 15 minutes, before pay is calculated.
- 7-minute rule
- A rounding convention for the nearest quarter hour: 1 to 7 minutes round down to the mark, 8 to 14 round up to the next quarter.
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.
How do I calculate paid hours with a lunch break?
First find the full duration from clock-in to clock-out, then subtract the unpaid break. For 8:00 AM to 4:30 PM the duration is 8 hours 30 minutes; take off a 30-minute unpaid lunch and you have 8 hours 0 minutes of paid time, or 8.0 decimal hours. Multiply that by your rate for the pay owed.
How does payroll time rounding work?
Many employers round each punch to the nearest 15 minutes using the 7-minute rule: 1 to 7 minutes past a quarter-hour mark round down, 8 to 14 round up. Under United States federal law rounding is allowed as long as it is neutral over time and does not consistently favor the employer. This tool gives the exact duration so you can apply whatever rounding your policy requires.
Does the calculator include seconds?
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. For stopwatch-style spans where seconds matter, use a dedicated elapsed-time or stopwatch tool.
What is the difference between this and a date duration calculator?
This tool measures the gap between two clock times within a single day or a single overnight crossing. If your span covers multiple calendar days, or you need the answer in days and weeks as well as hours, use a date and time duration calculator that includes the calendar dates.
How do I convert the result into total minutes or back into hours?
Total minutes is the raw duration before splitting into hours, so 8 hours 30 minutes is 8 x 60 + 30 = 510 minutes. To go the other way, divide the total minutes by 60: the whole part is the hours and the remainder is the minutes. The calculator shows both forms at once.