Skip to main content
Dates & TimeFree · no sign-up

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.

30 min

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.

StartEndBreak (minutes)Gross spanPaid durationDecimal hoursOvernight
09:0017:30308 h 30 m8 h 00 m8.00No
09:0017:0008 h 00 m8 h 00 m8.00No
09:0017:00608 h 00 m7 h 00 m7.00No
08:0016:30308 h 30 m8 h 00 m8.00No
09:1517:45308 h 30 m8 h 00 m8.00No
07:3016:00458 h 30 m7 h 45 m7.75No
06:0014:30208 h 30 m8 h 10 m8.17No
09:0017:2008 h 20 m8 h 20 m8.33No
10:0014:1504 h 15 m4 h 15 m4.25No
12:0020:45308 h 45 m8 h 15 m8.25No
22:0006:3008 h 30 m8 h 30 m8.50Yes
23:0007:00308 h 00 m7 h 30 m7.50Yes
19:0003:00458 h 00 m7 h 15 m7.25Yes
08:0008:00024 h 00 m24 h 00 m24.00Yes
09:0010:00901 h 00 m0 h 00 m0.00No
Decimal hours are rounded to two places for display; the engine keeps the exact fraction, so 8 hours 10 minutes is 8.1666 recurring and shows as 8.17. Overnight rows are shifts where the end time is at or before the start time. Nothing in this table decides what is payable: that is set by your contract and by local law.

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
Hours between two clock times09:00 to 17:30 is 8h 30m gross, which is 8.50 decimal hours; taking off a 30 minute unpaid break leaves 8h 00m, or 8.00 hours.GROSS SPAN, LESS THE UNPAID BREAK09:0017:30paid 8h 00mbreak 30 min8h 30m is 8.50, not 8.30H:MM AND DECIMALgross span8h 30mgross as decimal8.50 hunpaid break0h 30mpaid time8h 00mdecimal hours8.00
The unpaid break comes out of the gross span, and 8 hours 30 minutes is 8.50 decimal hours, not 8.30.
The worked defaults, 09:00 to 17:30 with a 30-minute break
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.

The overnight rule in practice, 22:00 to 06:30
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