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
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.
- 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.
- 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.
- 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.
- 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.
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.
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.
Frequently asked questions.
Why does 9:15 to 17:45 give 8.5 hours and not 8.30?
I entered the same start and end time and got 24 hours. Is that right?
How do I total a week of shifts without rounding errors?
Does it account for daylight saving time?
Can I measure a span longer than a day?
What if the start and end are in different time zones?
References& sources.
- [1]International Organization for Standardization, ISO 8601-1:2019 — Date and time representations. Specifies the unambiguous 24-hour clock convention this calculator's hour/minute inputs follow.
- [2]U.S. National Institute of Standards and Technology (NIST), Time and Frequency Division. Maintains the U.S. civil time standard against which clock-time arithmetic is ultimately calibrated.
- [3]Internet Engineering Task Force, RFC 3339 — Date and Time on the Internet: Timestamps. The IETF profile of ISO 8601 defining unambiguous time-of-day representation.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- 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