Audited 27 Jul 2026·Last updated 28 Oct 2026·3 citations·Tier 2·0 uses

Hours Between Times Calculator

Find the hours and minutes between two clock times on the 24-hour clock, overnight spans included: decimal hours, total minutes and a midnight-crossing flag.

Hours Between Times Calculator

Hour of the start time, 24-hour clock (0 = midnight, 13 = 1 PM).
Minute of the start time (0–59).
Hour of the end time, 24-hour clock. If this is numerically at or before the start hour/minute (e.g. an overnight 22:00 → 06:00 span, or an identical reading), the calculator assumes the span crosses midnight and adds 24 hours.
Minute of the end time (0–59).
Elapsed hours
8.5
The span in decimal hours, total minutes divided by 60 and rounded to two decimals, the form timesheets use.
Hours
8 hrs
Minutes
30 min
Total minutes
510 min
Crosses midnight?
No

Background.

Clock times do not subtract the way ordinary numbers do. From 9:15 to 17:45 is not 8.30 hours, because an hour has 60 minutes rather than 100; it is 8 hours 30 minutes, which a timesheet would write as 8.5. And from 22:00 to 06:00 is not minus sixteen hours, it is eight, because the clock went past midnight on the way.

Both problems disappear once each time is turned into minutes since midnight. 9:15 is minute 555 of the day and 17:45 is minute 1,065; the gap is 510 minutes, and dividing by 60 gives the decimal hours that payroll and billing systems want. When the end time sits at or before the start time on the clock face, the span has to have crossed midnight, so a full day of 1,440 minutes is added before anything else is done.

That midnight rule has one consequence worth knowing in advance. Enter the same time at both ends, say 08:00 to 08:00, and the answer is 24 hours, not zero, because a bare clock reading cannot say whether no time passed or a whole day did, and the rule always reads forward to the next time the clock shows the end reading. Spans can therefore run from one minute up to exactly 24 hours, and nothing longer.

Times go in on the 24-hour clock, the form ISO 8601 uses, so there is no AM or PM to get wrong. There are no dates or time zones either: the arithmetic counts what the wall clock shows, which matters on the two nights a year when daylight-saving clocks change. Useful cases include a night shift, the length of a flight from scheduled departure to arrival in the same time zone, or how long a meeting, a call or a lab run took.

What is hours between times calculator?

The time between two clock readings is the number of minutes from the first reading forward to the next moment the clock shows the second one. On a 24-hour clock each reading is a minute of the day from 0 (00:00, midnight) to 1,439 (23:59). Elapsed time is the end minute minus the start minute, or that difference plus 1,440 when the clock passes midnight. Decimal hours express the same span as a single number by dividing the minutes by 60, so 45 minutes is 0.75 hours.

How to use this calculator.

  1. Enter the start time as an hour from 0 to 23 and a minute from 0 to 59. For afternoon and evening times add 12 to the hour, so 1:30 PM is hour 13 and minute 30; midnight is hour 0 and noon is hour 12.
  2. Enter the end time the same way, exactly as the clock showed it. For a shift from 10 PM to 6 AM, enter 22:00 and 06:00; the midnight crossing is detected for you.
  3. Read hours and minutes together for the plain answer, decimal hours for a timesheet or invoice, or total minutes if you are adding several spans.
  4. Check the midnight flag. If it says Yes and you did not expect the span to run overnight, the start and end may have been entered the wrong way round.

The formula.

T = (end − start + 1440) mod 1440, if ≤ 0 add 1440

Each time becomes minutes since midnight: start = startHour × 60 + startMinute and end = endHour × 60 + endMinute. The raw difference is end − start. If it is greater than zero, that is the answer. If it is zero or negative, the span is taken to have crossed midnight and 1,440, the number of minutes in a day, is added. The result is therefore always between 1 and 1,440 minutes.

From the total, whole hours are the minutes divided by 60 with the remainder dropped, and the leftover minutes are the remainder. Decimal hours are total minutes divided by 60, rounded to two decimal places; 25 minutes becomes 0.42 and 50 minutes becomes 0.83. The midnight flag simply records whether the 1,440 had to be added.

The method assumes the end comes after the start and less than a day later, and that the clock ran evenly in between. It cannot tell a 30-minute span from one lasting a day and a half, and it does not adjust for a daylight-saving change or for the two times being read in different time zones.

A worked example.

Example

A shift starts at 9:15 and ends at 17:45, entered as hour 9 minute 15 and hour 17 minute 45. The start is 9 × 60 + 15 = 555 minutes after midnight, and the end is 17 × 60 + 45 = 1,065. The difference, 1,065 − 555 = 510 minutes, is positive, so the shift did not cross midnight and nothing is added. 510 minutes is 8 whole hours (480 minutes) with 30 left over: 8 hours 30 minutes, or 510 ÷ 60 = 8.5 decimal hours. If that day included an unpaid half-hour lunch, the paid time would be 480 minutes, exactly 8 hours; only the gap between the two clock readings is measured here, so the break comes off separately, which the time card calculator does for you.

end Hour17
start Hour9
start Minute15
end Minute45

Frequently asked questions.

Why does 9:15 to 17:45 give 8.5 hours and not 8.30?
Because the part after the point in decimal hours is a fraction of an hour, not a count of minutes. Thirty minutes is half an hour, so it becomes .5. Writing 8.30 would mean 8 hours and 18 minutes. Timesheets and invoices that multiply hours by a rate need the decimal form, not the clock form.
I entered the same start and end time and got 24 hours. Is that right?
It is the intended reading. A clock showing 08:00 at both ends could mean no time passed or a full day passed, and the forward-to-the-next-occurrence rule picks the full day. If you actually meant a span of zero, the answer is simply zero and there is nothing to calculate.
How do I total a week of shifts without rounding errors?
Add the total-minutes figures and divide by 60 once at the end. Five shifts of 7 hours 20 minutes are 2,200 minutes, or 36.67 hours. Adding the rounded daily figure of 7.33 five times gives 36.65, a little over a minute short. Over many people or many weeks those small gaps add up.
Does it account for daylight saving time?
No. It counts the difference in clock readings, not the time that actually passed. On the night clocks go forward an hour, a 22:00 to 06:00 shift lasts 7 real hours, and on the night they go back it lasts 9, but both show 8 hours here. Add or subtract the hour yourself on those two nights.
Can I measure a span longer than a day?
Not with two clock times alone, because nothing tells the arithmetic how many midnights passed. The longest span it can represent is 24 hours. For a span such as Monday 18:00 to Wednesday 07:30, use the date difference calculator, which takes calendar dates as well as times.
What if the start and end are in different time zones?
Convert one of them first, so both readings are on the same clock. A flight leaving at 10:00 in one city and landing at 13:00 local time in a city two hours ahead has been in the air for 1 hour, not 3. The time zone converter can put both times on one clock.

How this page was produced

Published by
Quanta Calculator
Primary sources
3 cited below
Method
T = (end − start + 1440) mod 1440, if ≤ 0 add 1440
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon