Time Duration Calculator
Hours and minutes between two clock times, less an unpaid break, in decimal hours for payroll.
Updated
When the shift began.
An earlier time means it ran overnight.
Time worked
8h 0m
8.00 decimal hours
- Decimal hours (payroll)
- 8.00
- Paid minutes
- 480 min
- Before the break
- 8h 30m (510 min)
- Break deducted
- 30 min
- Crossed midnight
- No
An identical start and end time reads as a full 24 hours, not zero, because a shift that ends at the moment it began is the one case where clock times alone cannot tell a zero-length shift from a day-long one. Decimal hours are the form most payroll systems want: 8h 30m is 8.50, not 8.30.
In short
How many hours are there between two times?
Convert both clock times to minutes past midnight, subtract, then take off the unpaid break. From 09:00 to 17:30 is 510 minutes, and a 30-minute break leaves 480: exactly 8 hours, or 8.00 decimal hours for a timesheet. An end at or before the start reads as an overnight shift, so 22:00 to 06:30 is 8 hours 30 minutes.
Payroll systems want decimal hours rather than hours and minutes, and the two are not the same string: 8 hours 30 minutes is 8.50, not 8.30.
How to use the time duration calculator
Enter a start time, an end time and the unpaid break in minutes, and the tool returns how long the shift actually was. The example loaded runs 09:00 to 17:30 with a 30-minute break, which is 510 gross minutes and 480 paid, or exactly 8 hours.
Times use native inputs, so your device shows them in whatever format you are used to while the value stored underneath stays unambiguous. The break is entered as a number of minutes rather than as a second pair of times, because that is the shape it arrives in on a timesheet or a rota, and because most breaks are recorded as a duration rather than as a window.
510
Gross minutes
09:00 to 17:30, the example loaded
480
Paid minutes
after the 30-minute break
8.00
Decimal hours
exactly 8 hours 0 minutes
The result is given three ways because three different readers need it. Hours and minutes is the form a person understands: 8 hours 0 minutes on the defaults, 7 hours 45 minutes for an 07:30 to 16:00 shift with 45 minutes off.
Decimal hours is the form payroll and invoicing systems want, and it is the only one that multiplies correctly against an hourly rate. The two are easy to confuse in writing, and the confusion is expensive: 8 hours 30 minutes is 8.50 decimal hours, not 8.30, a gap of twelve minutes on a single shift and over an hour across a week. Total minutes sits underneath both as the figure everything else is derived from.
Shifts that cross midnight are therefore handled without a date field, and that behaviour is the point of the tool for anyone working nights, since a night shift is exactly the case where people reach for a calculator.
It also fixes the meaning of the awkward case where the start and end times are identical: 08:00 to 08:00 is read as a full 24 hours rather than zero, because a shift that begins and ends at the same clock time has run all the way around.
Two limits are worth knowing before you rely on the number. First, the tool works in clock time only and has no date attached, so it cannot span more than 24 hours and cannot know about a daylight-saving transition inside your shift. In most of Europe and North America one night a year is 23 hours long and another is 25, and a shift crossing that hour will be paid differently depending on your local rules.
Second, nothing here decides what should be paid. Whether a break is unpaid, whether travel counts, and what overtime rate applies after a given number of hours are all questions for your contract or your national law, not for a subtraction.
From hours worked to annual pay
This tool stops at the duration and makes no judgement about pay. The hourly to salary calculator takes a rate and the hours you work and reports the yearly figure.
Open the hourly to salary calculator →Do
- Enter the break as a number of minutes, the shape a timesheet records it in.
- Copy the decimal hours into payroll rather than the hours and minutes.
- Enter the times as they happened when the shift crossed midnight.
- Check your contract and local law for what is actually payable.
Don't
- Write 8 hours 30 minutes as 8.30 in a payroll field.
- Add 24 hours yourself to make an overnight shift come out positive.
- Read a zero paid duration as a bug rather than a mistyped break.
- Expect clock-time arithmetic to know about a daylight-saving night.
Common shift patterns run through this page’s engine, showing the gross span before the break, the paid duration in hours and minutes, and the same duration as decimal hours. The last two rows are the edge cases the tool handles deliberately rather than rejecting.
| Start | End | Break (minutes) | Gross span | Paid duration | Decimal hours | Overnight |
|---|---|---|---|---|---|---|
| 09:00 | 17:30 | 30 | 8 h 30 m | 8 h 00 m | 8.00 | No |
| 09:00 | 17:00 | 0 | 8 h 00 m | 8 h 00 m | 8.00 | No |
| 09:00 | 17:00 | 60 | 8 h 00 m | 7 h 00 m | 7.00 | No |
| 08:00 | 16:30 | 30 | 8 h 30 m | 8 h 00 m | 8.00 | No |
| 09:15 | 17:45 | 30 | 8 h 30 m | 8 h 00 m | 8.00 | No |
| 07:30 | 16:00 | 45 | 8 h 30 m | 7 h 45 m | 7.75 | No |
| 06:00 | 14:30 | 20 | 8 h 30 m | 8 h 10 m | 8.17 | No |
| 09:00 | 17:20 | 0 | 8 h 20 m | 8 h 20 m | 8.33 | No |
| 10:00 | 14:15 | 0 | 4 h 15 m | 4 h 15 m | 4.25 | No |
| 12:00 | 20:45 | 30 | 8 h 45 m | 8 h 15 m | 8.25 | No |
| 22:00 | 06:30 | 0 | 8 h 30 m | 8 h 30 m | 8.50 | Yes |
| 23:00 | 07:00 | 30 | 8 h 00 m | 7 h 30 m | 7.50 | Yes |
| 19:00 | 03:00 | 45 | 8 h 00 m | 7 h 15 m | 7.25 | Yes |
| 08:00 | 08:00 | 0 | 24 h 00 m | 24 h 00 m | 24.00 | Yes |
| 09:00 | 10:00 | 90 | 1 h 00 m | 0 h 00 m | 0.00 | No |
Decimal hours, where timesheets lose money
Decimal hours are where timesheets most often lose money, and the arithmetic is worth spelling out. Decimal hours are paid minutes divided by 60, so 15 minutes is 0.25, 20 minutes is 0.33 recurring, 30 minutes is 0.5 and 45 minutes is 0.75.
Writing 8 hours 30 minutes as 8.30 in a payroll field understates the shift by twelve minutes, and repeated across five shifts that is an hour a week. The tool shows both forms side by side for exactly this reason.
0.25
15 minutes
a quarter of an hour
0.50
30 minutes
never written 8.30 for 8 h 30 m
0.75
45 minutes
three quarters of an hour
The formula, worked line by line
Everything happens in minutes past midnight, which removes every base-60 trap in one step. A clock time becomes a single integer, the subtraction becomes ordinary arithmetic, and only the final result is converted back into hours and minutes. Trying to subtract 09:00 from 17:30 directly by treating the times as decimal numbers is where hand calculations go wrong, because the minutes column carries at 60 rather than at 100 and a spreadsheet formatted as a number will not tell you.
The overnight case is a deliberate reading rather than an error branch. When the end time is at or before the start, 24 hours are added before subtracting, which turns a negative or zero result into the shift the person actually worked.
That single rule covers both night shifts and the identical-times case, and it is why 08:00 to 08:00 returns a full day rather than nothing. The break is deducted last, and the result is floored at zero so a break longer than the shift can never produce negative time.
start minutes = start hour x 60 + start minute
end minutes = end hour x 60 + end minute
gross minutes = end minutes - start minutes, or + 1440 when end is at or before start
paid minutes = max(0, gross minutes - break minutes)
hours = floor(paid minutes / 60), minutes = paid minutes mod 60
decimal hours = paid minutes / 60- Start
- 9 × 60 = 540 minutes past midnight
- End
- 17 × 60 + 30 = 1,050
- Gross span
- 1,050 − 540 = 510 minutes (8 h 30 m)
- Unpaid break
- 510 − 30 = 480 minutes
- Paid duration
- 480 ÷ 60 = 8 hours 0 minutes, or 8.00 decimal hours
An 09:15 to 17:45 shift with the same break gives the identical 480 minutes, because both ends moved by the same 15 minutes.
- Start
- 22 × 60 = 1,320 minutes past midnight
- Finish
- 06:30 is 390, so a plain subtraction gives minus 930
- End is before start
- add 1,440: 390 + 1,440 = 1,830
- Subtract the start
- 1,830 − 1,320 = 510 minutes
- The shift actually worked
- 8 hours 30 minutes
The same rule handles equal times: 08:00 to 08:00 gives 480 plus 1,440 minus 480, which is 1,440 minutes, a full 24 hours. Treating that as zero would be defensible in the abstract and useless in practice, since nobody enters a shift of no length on purpose.
Questions people ask
Related guides
Putting JSON in a URL: Validate, Minify, Percent-Encode, or Base64url?
A decision guide for flattening, encoding, checking, and safely transporting JSON in a query string.
August 11, 2026 · 9 min read
How Many Grams in a Cup? Every Ingredient, One Chart
One formula, fourteen densities. Why flour is 120 g, honey is 340 g, and the ingredient — not the cup — decides the number.
August 10, 2026 · 14 min read
How Are Loan Payments Calculated? Amortization, Explained
One level payment, front-loaded interest — the formula worked by hand, the two levers you control, and why the smaller payment is often the costlier loan.
July 23, 2026 · 13 min read