Hours Calculator

Last updated June 10, 2026

Enter a start and end time to see the duration.

An hours calculator finds the elapsed time between two clock times — for example, 9:00 AM to 5:30 PM is 8 hours 30 minutes, or 8.50 decimal hours. If the end time is earlier than the start time, the span is treated as crossing midnight, which makes overnight shifts come out right.

How to calculate hours between two times

  1. Convert both times to a 24-hour clock (5:30 PM → 17:30).
  2. Subtract the start from the end: 17:30 − 9:00 = 8 hours 30 minutes.
  3. If the result is negative, the period crosses midnight — add 24 hours: a 10:00 PM to 6:00 AM shift is (6:00 + 24:00) − 22:00 = 8 hours.
  4. Subtract any unpaid break, then convert minutes to decimal by dividing by 60 if your payroll needs decimal hours.

Worked example: a day shift with lunch

A shift from 7:45 AM to 4:15 PM with a 45-minute unpaid lunch: 16:15 − 7:45 = 8 hours 30 minutes; minus 0:45 leaves 7 hours 45 minutes, which is 7.75 decimal hours. At $18/hour that's 7.75 × 18 = $139.50 gross for the day.

Worked example: an overnight shift

Night shifts are where manual math most often goes wrong, because the clock rolls past midnight and a plain subtraction gives a negative answer. Say you clock in at 10:30 PM and out at 6:45 AM with a 30-minute unpaid break. Because the out time (6:45) is earlier than the in time (22:30), the span crosses midnight: add 24 hours to the out time first. (6:45 + 24:00) − 22:30 = 30:45 − 22:30 = 8 hours 15 minutes. Subtract the 30-minute break and you have 7 hours 45 minutes, or 7.75 decimal hours. The calculator above does this automatically — whenever the end time is earlier than the start time, it assumes the shift ran overnight.

Why payroll uses decimal hours

The result is shown two ways: as hours and minutes (h:mm) and as decimal hours. The h:mm format is how people read a clock, but payroll systems multiply pay by decimal hours, because you cannot multiply a wage by "8 hours 30 minutes" directly. Decimal hours convert the minutes into a fraction of an hour: 30 minutes is 0.5 of an hour, 15 minutes is 0.25, 45 minutes is 0.75. The conversion is simply minutes ÷ 60. A common mistake is to read 8 hours 30 minutes as "8.30" and multiply by that — it should be 8.50, a difference that quietly underpays every paycheck. If you work with whole timesheets, the dedicated decimal hours converter prints a full minutes-to-decimal chart.

Common shift lengths

ShiftSpanWith 30-min breakDecimal
9 to 59:00 AM – 5:00 PM7:307.50
8 to 4:308:00 AM – 4:30 PM8:008.00
7 to 7 (day)7:00 AM – 7:00 PM11:3011.50
Night shift11:00 PM – 7:00 AM7:307.50
Half day9:00 AM – 1:00 PM3:303.50

Frequently asked questions

How does the overnight calculation work?

When the end time is earlier than (or equal to) the start time, the calculator assumes the span crosses midnight and adds 24 hours. 10:00 PM to 6:00 AM therefore counts 8 hours, not −16.

What time formats can I type?

12-hour (9:00 AM, 9am, 5 p.m.), 24-hour (17:30), and military (0930, 1730) all work.

How do I turn the result into pay?

Multiply the decimal hours by your hourly rate. For a full week with overtime rules, use the time card calculator — it splits regular and overtime hours and computes gross pay.

What if the start and end times are the same?

Identical start and end times are treated as a full 24-hour span rather than zero, since an out time that equals the in time is read as crossing midnight a full day later. If you meant a zero-length entry, clear one of the fields.

Does it count seconds?

No — the calculator works in whole minutes, which is what time cards and payroll use. Enter times to the minute.

Should I subtract paid breaks?

Only enter unpaid breaks in the break field. Short paid rest breaks count as time worked, so leave them inside your start-to-end span.

Is my data stored anywhere?

No — the calculation runs entirely in your browser and nothing is transmitted.