Skip to content

Hours Calculator: Hours Between Two Times

Type a start time and an end time, take off a break if there was one, and read the result as hours and minutes, decimal hours and total minutes. Overnight spans are handled.

Runs in your browserFree, no sign-upLast reviewed

Settings

12-hour with AM/PM or 24-hour. 9am, 9:00 AM, 09:00 and 0900 all work.

If this is earlier than the start, it is counted as the next day.

Unpaid break to subtract. Use 0 for none.

Results update automatically as you type.

Result

Hours after break
8:00
h:mm
Hours and minutes
8 hours
Decimal hours
8.00
Total minutes
480

Breakdown

StepValue
Start9:00 AM (09:00)
End5:30 PM (17:30)
Time between start and end8 hours 30 minutes (8:30)
Break30 minutes (0:30)
After break8 hours (8:00)
As a decimal8.00 hours

Summary

9:00 AM to 5:30 PM is 8 hours 30 minutes. Minus a 30 minute break: 8 hours (8.00 hours).

Quick answers

How many hours is 9 to 5?
9:00 AM to 5:00 PM is 8 hours. With a 30-minute unpaid break it is 7 hours 30 minutes (7.50 decimal hours), and with a 1-hour lunch it is 7 hours.
How do I calculate the hours between two times?
Write both times in 24-hour form and subtract the start from the end, borrowing 60 minutes from the hours when needed. From 08:45 to 17:20: 17:20 minus 08:45 is 8 hours 35 minutes. If the end is earlier than the start, add 24 hours to the end first.
How many hours is 8 AM to 5 PM with a 1 hour lunch?
8 hours. 8:00 AM to 5:00 PM is 9 hours on the clock, and taking off a 60-minute lunch leaves 8 hours, or 8.00 decimal hours.
How many hours is 10 PM to 6 AM?
8 hours. The span crosses midnight, so it is 2 hours up to midnight plus 6 hours after it. With a 30-minute break it is 7 hours 30 minutes, or 7.50 decimal hours.
How do I turn hours and minutes into decimal hours?
Divide the minutes by 60 and add the result to the hours. 7 hours 45 minutes is 7 + 45 ÷ 60 = 7.75 hours, and 8 hours 20 minutes is 8.33 hours rounded to two places.
How many hours is 7 AM to 7 PM?
12 hours. With a 1-hour break it is 11 hours. The same holds for a 7:00 PM to 7:00 AM night shift, which also spans 12 hours.

Why use Hours Calculator

The hours between two times are the end time minus the start time, less any break. From 9:00 AM to 5:30 PM is 8 hours 30 minutes, and with a 30-minute lunch that leaves 8 hours, or 8.00 in decimal. This hours calculator does that subtraction for one pair of times. Enter each time in 12-hour form with AM or PM or in 24-hour form, add break minutes if you need to, and it returns the duration as h:mm, in words, as decimal hours and as total minutes. When the end time is earlier than the start, it counts the end as the next day, so night shifts work without any extra setting.

Hours in common shifts, with and without a break

Each row was run through the calculator. Time on the clock is end minus start; hours after break is what is left once the break is removed.

StartEndTime on the clockBreakHours after breakDecimal hours
9:00 AM5:00 PM8 hoursnone8:008.00
9:00 AM5:00 PM8 hours30 min7:307.50
9:00 AM5:00 PM8 hours60 min7:007.00
9:00 AM5:30 PM8 hours 30 minutes30 min8:008.00
9:00 AM6:00 PM9 hours60 min8:008.00
8:00 AM4:30 PM8 hours 30 minutes30 min8:008.00
8:00 AM5:00 PM9 hours60 min8:008.00
8:30 AM5:00 PM8 hours 30 minutes60 min7:307.50
7:00 AM3:30 PM8 hours 30 minutes30 min8:008.00
6:00 AM2:00 PM8 hours20 min7:407.67
2:00 PM10:00 PM8 hours30 min7:307.50
10:00 PM6:00 AM8 hours30 min7:307.50
11:00 PM7:00 AM8 hours30 min7:307.50
7:00 AM7:00 PM12 hours60 min11:0011.00
7:00 PM7:00 AM12 hours60 min11:0011.00

Formula for hours between a start time and an end time

Hours = (end time − start time) − break, where 24 hours are added to the end time if it is earlier than the start time

Convert both times to minutes after midnight, subtract, then take off the break. For 9:05 AM to 5:20 PM with a 30-minute break: 5:20 PM is 17 × 60 + 20 = 1,040 minutes and 9:05 AM is 9 × 60 + 5 = 545 minutes. 1,040 − 545 = 495 minutes, and 495 − 30 = 465 minutes. Dividing by 60 gives 7 hours with 45 minutes left over, so the answer is 7:45, or 465 ÷ 60 = 7.75 decimal hours. The calculator returns exactly these figures for those inputs.

Worked examples, including an overnight shift

Office day with a half-hour lunch

Start time 9:00 AM, End time 5:30 PM, Break 30

Hours after break 8:00, Decimal hours 8.00, Total minutes 480

These are the values the page loads with. The Breakdown shows 8 hours 30 minutes on the clock before the break.

Night shift that crosses midnight

Start time 10:00 PM, End time 6:00 AM, Break 30

Hours after break 7:30, Decimal hours 7.50, Total minutes 450

6:00 AM is earlier than 10:00 PM, so the end is counted as the next day: 2 hours before midnight plus 6 after is 8 hours, minus the break.

24-hour times typed without a colon

Start time 0900, End time 1730, Break 0

Hours between 8:30, Decimal hours 8.50, Total minutes 510

Two minutes across midnight

Start time 11:59 PM, End time 12:01 AM, Break 0

Hours between 0:02, Decimal hours 0.03, Total minutes 2

12:01 AM is one minute after midnight, not one minute after noon.

Times with seconds

Start time 8:15:30, End time 12:00:10, Break 0

Hours between 3:44:40, Decimal hours 3.74, Total minutes 224.67, Total seconds 13,480

Seconds appear in the result only when one of the inputs has them.

A full day

Start time 9:00, End time 9:00, End time falls on: The next day

Hours between 24:00, Decimal hours 24.00, Total minutes 1,440

On Automatic, identical start and end times give 0 and a note explaining why.

Time formats the start and end fields accept

A time without AM or PM is read as 24-hour time, so 5:30 on its own means 5:30 in the morning.

  • 12-hour with a suffix: 9:00 AM, 9:00am, 9 am, 9a, 5:30 PM, 5:30 p.m.
  • 24-hour with a colon: 09:00, 9:00, 17:30, 00:15.
  • 24-hour without a colon: 0900, 1730, 930.
  • A bare hour: 9 means 09:00 and 17 means 17:00.
  • With seconds: 8:15:30 or 8:15:30 PM.
  • The words noon, midday and midnight.
  • 24:00 for midnight at the end of the day, so 00:00 to 24:00 is 24 hours.
  • A dot instead of a colon, as in 9.30 am.

Breaks, midnight and the limits of a two-time calculation

The break is a single number of minutes taken off the elapsed time. If you had two breaks, add them and enter the sum. A break longer than the span between the two times is rejected with a message rather than shown as a negative or zero result, because it nearly always means one of the times was mistyped.

12:00 AM is midnight and 12:00 PM is noon. Mixing these up is the most common reason a result is 12 hours out, so check the suffix when a shift starts or ends at twelve.

The result covers one start and one end within a 24-hour window, or up to 48 hours with The next day selected. It does not take dates, so it cannot measure a span of several days, and it does not allow for a clock change: on the night clocks go forward or back, an overnight shift is an hour shorter or longer than the figure shown. For several shifts with a weekly total and pay, the timesheet calculator on this site takes a list of shifts instead of one pair of times.

How to use it

  1. 1

    In Start time, type when the period begins, for example 9:00 AM, 9am, 09:00 or 0900.

  2. 2

    In End time, type when it finishes, for example 5:30 PM or 17:30. The two fields do not have to use the same format.

  3. 3

    In Break (minutes), enter the unpaid break to subtract, or 0 if there is none.

  4. 4

    Leave End time falls on set to Automatic unless you want to force The same day or The next day, for instance to measure a full 24 hours.

  5. 5

    Read Hours after break (or Hours between when the break is 0), Decimal hours and Total minutes under Result. The Breakdown table shows the time before and after the break.

Common questions

Can I mix 12-hour and 24-hour times?
Yes. Each field is read on its own, so a start of 9:00 AM and an end of 17:30 gives 8 hours 30 minutes. A time with no AM or PM is always treated as 24-hour time.
What happens if the end time is earlier than the start time?
On the Automatic setting the end is moved to the next day and a note says so. If you choose The same day instead, the calculator shows an error, which is useful when you want to catch a mistyped time rather than get an overnight result.
Why does 8 hours 20 minutes show as 8.33 and not 8.20?
Decimal hours express the minutes as a fraction of 60. Twenty minutes is 20 ÷ 60 = 0.333 of an hour, which rounds to 0.33. Only 0, 15, 30 and 45 minutes come out as the tidy decimals .00, .25, .50 and .75.
Does it calculate pay?
No. It returns time only. Multiply the Decimal hours figure by your hourly rate to get gross pay: 7.50 hours at 20 an hour is 150. The timesheet calculator on this site does that multiplication across a list of shifts.
Can it work out hours across several days?
No. It has no date fields, so the longest span is just under 48 hours using The next day. For the number of days between two dates, use a date difference calculator and add the part-day hours from this page.
Should the break be subtracted from my hours?
Only if it is unpaid. Whether a meal or rest break counts as working time depends on your contract and local law. Enter 0 for breaks that are paid so they stay inside the total.
Can I enter a break in hours instead of minutes?
The field is in minutes, so convert first: 1 hour is 60, an hour and a quarter is 75, and 1.5 hours is 90. Fractions of a minute are accepted, for example 22.5.
How accurate is the decimal hours figure?
It is rounded to two decimal places from the exact duration, so it is within 18 seconds of the true value. Use Total minutes when you need the unrounded amount, for instance 500 minutes rather than 8.33 hours.

Looking for something else? Browse all date & time tools or see every tool.