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.
Advertisement
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.
Advertisement
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
Advertisement
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.
Advertisement
Questions people ask
How many hours is 9 to 5 with a 30-minute break?
From 09:00 to 17:00 is 8 hours gross, and taking off a 30-minute unpaid break leaves 7 hours 30 minutes, or 7.50 decimal hours. The example loaded on this page runs to 17:30 instead, which gives 8 hours 30 minutes gross and exactly 8 hours paid after the same break. Enter your own clock-in and clock-out times to get the figure for your shift rather than the standard one.
How do I calculate a shift that crosses midnight?
Enter the times as they happened and the tool handles it. When the end time is at or before the start time, the shift is read as running into the next day and 24 hours are added before subtracting, so 22:00 to 06:30 returns 8 hours 30 minutes rather than a negative number. A 23:00 to 07:00 shift with a 30-minute break gives 7 hours 30 minutes. No date field is needed, because the arithmetic only ever spans a single wrap around the clock.
What are decimal hours and why do they differ from hours and minutes?
Decimal hours are the paid minutes divided by 60, which is the form payroll and invoicing systems expect because it multiplies correctly against an hourly rate. The trap is that the two notations look alike: 8 hours 30 minutes is 8.50 decimal hours, not 8.30. Fifteen minutes is 0.25, twenty minutes is 0.33 recurring, forty-five minutes is 0.75. Writing the wrong one understates a single shift by twelve minutes and a five-day week by an hour.
What happens if the break is longer than the shift?
The paid duration is floored at zero and the tool flags that the break exceeded the shift, rather than returning negative time. A 09:00 to 10:00 shift with a 90-minute break gives 1 hour gross and 0 hours paid. In practice that combination means something has been typed wrong, usually a break entered in hours instead of minutes, so the flag exists to send you back to the input rather than to hand you a plausible looking number.
Does this account for daylight saving or overtime rules?
No to both, deliberately. The tool works in clock time with no date attached, so it cannot know that one night a year runs 23 hours and another 25 where the clocks change; check your local rule for how that hour is paid. It also makes no judgement about what is payable. Whether a break is unpaid, how time is rounded, and what overtime rate applies come from your contract and from national law, not from a subtraction.
Related guides
Dates & Time
Time and a Half: The Regular Rate Is Not Your Hourly Wage
Every explanation says multiply your hourly rate by 1.5. That is the wrong number the moment a bonus, a shift differential, or a second pay rate enters the week.
August 30, 2026 · 8 min read
Dates & Time
Federal Holidays: the Dates, and the Rules Behind Them
Eleven federal holidays — but not always eleven days off. The holiday keeps its statutory date; only the day off moves, and sometimes it moves into the next year.
August 28, 2026 · 8 min read
Dates & Time
How Many Working Days Are in a Year?
250 working days, 2,000 hours, exactly 50 five-day weeks. That tidy set of numbers is true this year and wrong next year, and the leap year is not the reason.
August 28, 2026 · 6 min read