Hours Calculator

Calculate the hours between two times: enter a start and an end time and get the time between them in hours and minutes, plus the same span in decimal hours and total minutes. An end time earlier than the start counts as the next day, so night shifts work, an unpaid lunch break can be taken off, and both times are repeated in 24-hour (military) time.

8 hours

Decimal hours:
8.00
Hours:minutes:
8:00
Total minutes:
480
From and to:
9:00 AM to 5:30 PM
24-hour (military) time:
09:00 to 17:30
Total time, start to end:
8 hours, 30 minutes

Several days to add up? Use the time card calculator.

How DateMath calculates hours between two times

DateMath subtracts the start time from the end time on a 24-hour clock. When the end is earlier than the start, DateMath counts it on the next day, so a night shift needs no date, and the same time twice is 0 hours. With rounding on, both clock times are rounded to the nearest step first. The unpaid break is then taken off, and decimal hours are the minutes divided by 60, rounded to two places.

It follows the US hours-worked rules. Their rules and sources, and how DateMath tests its results, are on the About page.

Hours between two times, past midnight too

Enter a start and an end time and the calculator subtracts one from the other, minus the unpaid break you enter. When the end time is earlier than the start, DateMath counts it on the next day, so a night shift needs no dates. By hand, add 24 hours to the end and subtract, minutes first, for 9:40 PM to 6:15 AM the next day:

  1. Write both times on the 24-hour clock: 9:40 PM is 21:40 and 6:15 AM is 06:15.
  2. The end is earlier than the start, so it is on the next day: add 24 hours, and 06:15 becomes 30:15.
  3. Minutes: 15 is less than 40, so borrow 1 hour (60 minutes): 15 + 60 = 75, and 75 − 40 = 35.
  4. Hours: 30 − 1 borrowed = 29, and 29 − 21 = 8.

Result: 8 hours, 35 minutes (8.58 hours). The longest span is therefore 23 hours, 59 minutes, and the same start and end time give 0, not 24 hours; for longer spans, use the date duration calculator with dates. Times are clock times, so on the nights the clocks change a night shift really lasts one hour less (spring) or more (fall) than shown.

How long common shifts are

Shift lengths, before and after a 30-minute unpaid lunch (decimal hours in brackets)
ShiftHoursAfter a 30-minute lunch
9:00 AM to 5:00 PM8 hours7 hours, 30 minutes (7.50)
8:00 AM to 5:00 PM9 hours8 hours, 30 minutes (8.50)
7:00 AM to 3:30 PM8 hours, 30 minutes8 hours (8.00)
7:00 AM to 7:00 PM12 hours11 hours, 30 minutes (11.50)
3:00 PM to 11:00 PM8 hours7 hours, 30 minutes (7.50)
10:00 PM to 6:00 AM the next day8 hours7 hours, 30 minutes (7.50)

Enter only the break you aren't paid for. Under the federal Fair Labor Standards Act rules, rest breaks of about 5 to 20 minutes count as work time, while a bona fide meal period, ordinarily 30 minutes or more, doesn't; state law and your employer's policy can add rules. Two unpaid breaks go in as their sum. For a whole week, use the time card calculator; to find when a shift ends, the shift calculator.

Rounding clock-in and clock-out times

Many time clocks and payroll systems round punches to the nearest 5 minutes, tenth of an hour (6 minutes) or quarter hour. The "Round clock times" menu does the same before it counts, so the result matches a payroll that rounds the same way. Rounding to the nearest quarter hour moves 7 minutes past down and 8 minutes past up, because 7 is less than half of 15:

Punch times rounded three ways
PunchNearest 5 minNearest 6 minNearest 15 min
8:07 AM8:05 AM8:06 AM8:00 AM
8:08 AM8:10 AM8:06 AM8:15 AM
4:52 PM4:50 PM4:54 PM4:45 PM
4:53 PM4:55 PM4:54 PM5:00 PM

A shift punched 8:07 AM to 4:53 PM is 8 hours, 46 minutes as worked; rounded to the quarter hour it becomes 8:00 AM to 5:00 PM, or 9 hours. US federal rules accept rounding only if, over time, employees are still paid for all the time they actually work (29 CFR 785.48(b)), so compare both totals when you check a paycheck.

Decimal hours for pay and invoices

Every result also comes as decimal hours, the form you multiply by an hourly rate: the minutes divided by 60, so 30 minutes is 0.50 and 15 minutes 0.25. Don't read hours:minutes as a decimal: 7:18 is 7.30 hours, not 7.18. The result repeats both times in 24-hour (military) form, and the hours to decimal calculator converts any amount both ways.

Frequently asked questions

How do I calculate the hours between two times?
Subtract the start time from the end time: enter both and the calculator shows the hours and minutes between them. By hand, write both in 24-hour time first, so 9:15 AM to 5:45 PM is 17:45 − 9:15 = 8 hours 30 minutes.
How do I calculate hours worked overnight?
Enter the end time as it is: when it is earlier than the start, the calculator counts it on the next day, so 10:00 PM to 6:30 AM is 8 hours 30 minutes. By hand, add 24 hours to the end time first: 6:30 becomes 30:30, and 30:30 − 22:00 = 8:30.
How do I subtract a lunch break from my hours?
Type the unpaid break in minutes in the Break field and it is taken off the time between start and end. 8:00 AM to 4:30 PM is 8 hours 30 minutes, so with a 30-minute lunch it is 8 hours worked. For a whole week of shifts, use the time card calculator.
How many hours is 9 to 5?
8 hours: 9:00 AM to 5:00 PM is 8 hours, or 7 hours 30 minutes worked after a 30-minute unpaid lunch. 9:00 AM to 5:30 PM with a 30-minute lunch is exactly 8 hours worked.
Where does the calculator show decimal hours?
In the Decimal hours line under the result, rounded to two places, next to the same span as hours:minutes and in total minutes: 8 hours 30 minutes shows as 8.50 and 8:30. To convert any other amount, use the hours to decimal calculator.
Does it handle AM and PM?
Yes. The time fields follow your device's setting, 12-hour with AM and PM or 24-hour, and the result repeats the start and end in both forms. 12:00 AM is midnight and 12:00 PM is noon, so 11:00 AM to 1:30 PM is 2 hours 30 minutes.
How do I enter military time?
Type it as it is if your device uses a 24-hour clock; on a 12-hour device, enter it with AM or PM: 0600 is 6:00 AM and 1830 is 6:30 PM, because hours 13 to 23 are PM after subtracting 12. The result repeats both times in 24-hour (military) time, so 0600 to 1830 shows as 06:00 to 18:30, 12 hours 30 minutes.
What if the start and end times are the same?
The result is 0 hours, not 24. For a shift of exactly 24 hours or longer, use the date duration calculator, which takes a date with each time.
Can I calculate hours across more than one day?
Not with this calculator: it measures up to 23 hours 59 minutes, from the start to the next time the clock shows the end time. For longer spans, enter dates and times in the date duration calculator.
Does it account for daylight saving time?
No. It measures clock time, so a night shift across the spring-forward change shows one hour more than really passed, and one across the fall-back change one hour less. Correct the result by that hour on those two nights.
Can I round my clock-in and clock-out times?
Yes. Pick the nearest 5 minutes, 6 minutes (a tenth of an hour) or 15 minutes under "Round clock times", and both times are rounded before the hours are counted, as many time clocks do. To the nearest quarter hour, 8:07 AM becomes 8:00 AM and 8:08 AM becomes 8:15 AM.