Whether you are an employee checking your paycheck, a freelancer billing a client or a manager approving timesheets, you need to know exactly how many hours were worked. The math is simple once you know the steps, but small mistakes – especially with minutes and breaks – are common. This guide walks through the process with examples you can follow by hand, and shows where a calculator saves time.
The basic formula
Hours worked = End time − Start time − Unpaid breaks
That's it. The tricky parts are working with hours and minutes (which are base 60, not base 10), handling AM/PM, and shifts that cross midnight.
Step 1: Write both times in 24-hour format
Converting to 24-hour (military) time removes the AM/PM confusion. For PM times from 1:00 PM onward, add 12 to the hour: 5:30 PM becomes 17:30. Morning times stay the same, except 12:xx AM, which becomes 00:xx. If you need a refresher, use the military time converter.
Example: a shift from 8:45 AM to 5:15 PM becomes 08:45 to 17:15.
Step 2: Subtract start from end
Subtract the hours and minutes separately. If the end minutes are smaller than the start minutes, borrow one hour (60 minutes).
- 17:15 − 08:45 → minutes: 15 − 45 is negative, so borrow 1 hour: 75 − 45 = 30 minutes.
- Hours: 16 − 8 = 8 hours (17 became 16 after borrowing).
- Result: 8 hours 30 minutes.
An easier way is to convert both times to minutes after midnight: 08:45 = 525 minutes and 17:15 = 1035 minutes. 1035 − 525 = 510 minutes = 8 hours 30 minutes.
Step 3: Subtract unpaid breaks
If the employee took a 30-minute unpaid lunch, subtract it: 8:30 − 0:30 = 8 hours 0 minutes. Short paid rest breaks are usually not subtracted, but rules differ by country, state and employer, so check your local labor rules or company policy to know which breaks are paid.
Step 4: Convert to decimal hours for pay
Payroll systems multiply hours by an hourly rate, and that only works with decimal hours. 8 hours 30 minutes is 8.5 hours, not 8.30. Divide the minutes by 60: 30 ÷ 60 = 0.5. Our guide on converting minutes to decimal hours for payroll explains this in detail, and the minutes to decimal converter does it instantly.
Skip the manual math: use the free Hours Calculator – instant results, nothing to install.
Open the Hours Calculator →Overnight shifts (crossing midnight)
When a shift ends the next day, the end time is “smaller” than the start time, so simple subtraction gives a negative number. Fix it by adding 24 hours to the end time.
Example: 10:00 PM to 6:30 AM → 22:00 to 06:30. Add 24 hours to the end: 30:30. Then 30:30 − 22:00 = 8 hours 30 minutes.
The hours calculator detects overnight shifts automatically, so you don't need to do this by hand.
Calculating a full week
To total a week, calculate each day separately and then add them up. Add the hours and minutes separately, then convert every 60 minutes into one hour.
| Day | In | Out | Break | Worked |
|---|---|---|---|---|
| Mon | 08:45 | 17:15 | 0:30 | 8:00 |
| Tue | 09:00 | 17:40 | 0:30 | 8:10 |
| Wed | 08:30 | 16:50 | 0:45 | 7:35 |
| Thu | 09:10 | 18:00 | 0:30 | 8:20 |
| Fri | 08:00 | 15:30 | 0:30 | 7:00 |
Hours: 8 + 8 + 7 + 8 + 7 = 38. Minutes: 0 + 10 + 35 + 20 + 0 = 65 minutes = 1 hour 5 minutes. Weekly total: 39 hours 5 minutes, or 39.08 hours in decimal. The time card calculator does all of this in one table and can apply an hourly rate and overtime.
Common mistakes to avoid
- Treating minutes as decimals. 7:45 is 7.75 hours, not 7.45. This single error is the most common payroll mistake.
- Forgetting to subtract unpaid breaks – or subtracting paid ones.
- Mixing AM and PM. A 9 to 5 shift is 8 hours, but 9 AM to 5 AM is 20 hours.
- Rounding too early. Keep exact minutes until the final total, then round according to your employer's policy.
- Ignoring overtime rules. Hours beyond a daily or weekly threshold may be paid at a higher rate. See overtime calculation basics.
What about rounding rules?
Some employers round clock times to the nearest 5, 6 or 15 minutes. Whether rounding is allowed, and how, depends on local law and company policy. If your employer rounds, apply the rounding to each punch first, then calculate the hours. When in doubt, keep a record of your actual times – our timesheet tips explain how.
Frequently asked questions
How do I calculate hours worked between 9 AM and 5:30 PM?
Convert to 24-hour time: 09:00 to 17:30. Subtract: 8 hours 30 minutes. Subtract any unpaid break – for a 30-minute lunch, that leaves 8 hours, or 8.0 in decimal.
How do I calculate hours for a shift that goes past midnight?
Add 24 hours to the end time before subtracting. For 11 PM to 7 AM: 31:00 − 23:00 = 8 hours.
Is lunch included in hours worked?
Typically, unpaid meal breaks are excluded and short paid rest breaks are included, but the rules depend on where you work and your employment terms. Check your local regulations or employer policy.
Skip the manual math: use the free Hours Calculator – instant results, nothing to install.
Open the Hours Calculator →