On this page (10)
How to use this calculator#
- Enter both times on the 24-hour clock if you can17:40 is unambiguous; 5:40 needs a PM. If you are using AM and PM, remember 12:00 AM is midnight and 12:00 PM is noon — the one pair that trips almost everyone up.
- Turn on the overnight option for any shift finishing the next morningWhen the end time is earlier on the clock than the start, the span has crossed midnight and a full 24 hours must be added. Without it, a 22:30 to 06:15 shift comes out negative or wildly wrong.
- Add dates for anything longer than a dayWith dates on both ends the tool counts whole days and then the clock difference, so 14 March at 18:00 to 16 March at 03:30 returns 33 hours 30 minutes rather than guessing.
- Copy the decimal hours for payroll, the h:mm for rotasPayroll systems multiply decimal hours by a rate. Rota software, holiday balances and timesheets almost always want hours and minutes. The tool shows both so you never convert by hand.
The formula#
Minutes past midnight
Duration (minutes) = (60 × H₂ + M₂) − (60 × H₁ + M₁), and add 1,440 if the result is negative • Decimal hours = minutes ÷ 60
- H₁, M₁
- Hour and minute of the start time on a 24-hour clock
- H₂, M₂
- Hour and minute of the end time
- 1,440
- Minutes in a day — added once when the span crosses midnight
- Decimal hours
- The minute total divided by 60, which is the format payroll uses
- Multi-day spans
- Whole days between the two dates × 1,440, plus the clock difference
Working in a single unit removes the borrowing errors people make subtracting clock times by hand, where 17:40 minus 09:45 is often written as 8 hours 5 minutes instead of 7 hours 55. The 1,440-minute assumption breaks twice a year in regions observing daylight saving: one spring day has 1,380 minutes and one autumn day has 1,500. For spans crossing a changeover, use dated times rather than clock times alone.
How the duration is worked out#
Both times are converted into minutes past midnight, then subtracted. A 09:15 start is 555 minutes and a 17:40 finish is 1,060, giving 505 minutes — 8 hours and 25 minutes. Working in a single unit avoids the borrowing errors people make when subtracting clock times by hand, where 17:40 minus 09:45 is often mistakenly written as 8 hours 5 minutes.
Decimal hours are the minute total divided by 60. That 505-minute shift is 8.42 decimal hours, which is the format payroll systems and invoices expect. Note that 8 hours 25 minutes is not 8.25 hours — the fraction is 25/60, not 25/100. Mixing the two conventions is the single most common timesheet mistake.
Overnight spans and multi-day ranges#
When the end time is earlier on the clock than the start time, the span has crossed midnight. A shift from 22:30 to 06:15 looks negative at first, so 24 hours are added to give 7 hours 45 minutes. Enable the overnight option for any shift that finishes the next morning, otherwise the result will be wrong by a full day.
For spans longer than a day, add explicit dates to both ends. Then the calculation counts whole days between the dates and adds the clock difference, so 14 March at 18:00 to 16 March at 03:30 returns 33 hours 30 minutes. Dates also remove any ambiguity about which of two identical clock times came first.
Worked examples#
A normal working day with an unpaid lunch
09:15 to 17:40 with a 30-minute unpaid break.
- Start = 9 × 60 + 15 = 555 minutes past midnight
- End = 17 × 60 + 40 = 1,060 minutes past midnight
- 1,060 − 555 = 505 minutes elapsed, which is 8 hours 25 minutes
- 505 − 30 = 475 minutes paid
- 475 ÷ 60 = 7 remainder 55, so 7 hours 55 minutes
- As a decimal: 475 ÷ 60 = 7.92 hours
7 hours 55 minutes paid — 7.92 decimal hours. Writing it as 7.55 would underpay by 22 minutes.
A night shift crossing midnight
22:30 to 06:15 the following morning.
- Start = 22 × 60 + 30 = 1,350 minutes
- End = 6 × 60 + 15 = 375 minutes
- 375 − 1,350 = −975, which is negative, so the span crossed midnight
- −975 + 1,440 = 465 minutes
- 465 ÷ 60 = 7 remainder 45
7 hours 45 minutes — 7.75 decimal hours.
Reference tables#
| Minutes | Fraction of an hour | Decimal (2 dp) | Decimal (4 dp) |
|---|---|---|---|
| 1 | 1/60 | 0.02 | 0.0167 |
| 5 | 1/12 | 0.08 | 0.0833 |
| 6 | 1/10 | 0.10 | 0.1000 |
| 10 | 1/6 | 0.17 | 0.1667 |
| 12 | 1/5 | 0.20 | 0.2000 |
| 15 | 1/4 | 0.25 | 0.2500 |
| 20 | 1/3 | 0.33 | 0.3333 |
| 24 | 2/5 | 0.40 | 0.4000 |
| 25 | 5/12 | 0.42 | 0.4167 |
| 30 | 1/2 | 0.50 | 0.5000 |
| 35 | 7/12 | 0.58 | 0.5833 |
| 36 | 3/5 | 0.60 | 0.6000 |
| 40 | 2/3 | 0.67 | 0.6667 |
| 45 | 3/4 | 0.75 | 0.7500 |
| 48 | 4/5 | 0.80 | 0.8000 |
| 50 | 5/6 | 0.83 | 0.8333 |
| 54 | 9/10 | 0.90 | 0.9000 |
| 55 | 11/12 | 0.92 | 0.9167 |
| 60 | 1 | 1.00 | 1.0000 |
Read it backwards to convert decimals to minutes: 0.4 hours is 24 minutes, 0.75 hours is 45 minutes. Multiply the decimal part by 60.
| Hours and minutes | Total minutes | Decimal hours |
|---|---|---|
| 4:00 | 240 | 4.00 |
| 5:30 | 330 | 5.50 |
| 6:00 | 360 | 6.00 |
| 7:00 | 420 | 7.00 |
| 7:30 | 450 | 7.50 |
| 7:45 | 465 | 7.75 |
| 8:00 | 480 | 8.00 |
| 8:15 | 495 | 8.25 |
| 8:25 | 505 | 8.42 |
| 8:30 | 510 | 8.50 |
| 9:00 | 540 | 9.00 |
| 10:00 | 600 | 10.00 |
| 12:00 | 720 | 12.00 |
| 12:30 | 750 | 12.50 |
Only quarter-hour durations have a tidy decimal. Everything else needs the division, which is why 8:25 becoming 8.42 surprises people.
Common mistakes#
- Writing 8 hours 25 minutes as 8.25The correct decimal is 8.42. Written as 8.25 the entry loses 10 minutes, and across a five-day week that is nearly an hour of unpaid work. This is the single most common timesheet error, and it always favours the employer.
- Forgetting the overnight adjustmentA 23:00 to 07:00 shift subtracts to −16 hours. Some systems silently store the absolute value and report 16 hours instead of 8, doubling the entry. Any negative intermediate result means the span crossed midnight and needs 24 hours added.
- Assuming every day is exactly 24 hoursOn the spring daylight-saving changeover a day is 23 hours and on the autumn one it is 25. A night shift spanning either boundary is genuinely an hour shorter or longer than the clock suggests, and payroll rules differ on which figure is paid.
- Rounding each entry before adding them upRounding five daily figures to the nearest quarter-hour before summing can shift the weekly total by more than half an hour. Keep every row in whole minutes, sum them, and round only the final result.
Frequently asked questions#
How do I calculate a shift that ends after midnight?
Turn on the overnight option, or enter dates on both ends. The tool then adds a full day so a 23:00 to 07:00 shift correctly returns 8 hours.
What is the difference between 8:30 and 8.30 hours?
8:30 means 8 hours 30 minutes, which is 8.5 in decimal. Decimal hours divide the minutes by 60, so 8.30 decimal is actually 8 hours 18 minutes.
Should I subtract my lunch break?
This tool returns the raw elapsed time. Subtract unpaid breaks yourself, or use the work hours calculator, which has a break field on every row.
Key terms#
- Elapsed time
- The raw span between two clock times, before any breaks are deducted. What this calculator returns by default.
- Decimal hours
- Hours with the minutes expressed as a fraction of 60 — 7 hours 45 minutes is 7.75. The format payroll and invoicing systems expect.
- Minutes past midnight
- A single-number representation of a clock time, from 0 at 00:00 to 1,439 at 23:59. Makes subtraction trivial.
- 24-hour clock
- Times written 00:00 to 23:59 with no AM or PM. Removes the noon-and-midnight ambiguity entirely.
- Overnight shift
- A span whose end time is earlier on the clock than its start time, requiring a full day to be added.
- Daylight saving time
- The seasonal clock change that makes one day 23 hours and another 25 in the regions that observe it.
Sources#
- Fact Sheet #22: Hours Worked Under the Fair Labor Standards Act — US Department of Labor, Wage and Hour Division
- Daylight saving time — NIST Time and Frequency Division
- ISO 8601 date and time format — International Organization for Standardization
Figures last checked .
Put this calculator on your site
Free, no sign-up, and no attribution fee — just keep the credit line that comes with the code. The calculator stays up to date automatically.
