U

Time Duration Calculator

Calculate how much time passes between two clock times — hours and minutes apart, total minutes, and the duration written as a decimal number of hours.
Start time
9 h
h
0 h23 h
min
End time
17 h
h
0 h23 h
min
Interval

Elapsed Time

Breakdown

Remaining minutes
0minutes
In decimal hours
0hours

Key Assumptions

  • Times are entered on a 24-hour clock; minutes range from 0 to 59 and hours from 0 to 23.
  • The same-day setting expects the end time to fall after the start time. If it does not (for example 23:00 to 02:00), one full day is added automatically so the result stays positive.
  • Choosing 'overnight, ends next day' adds exactly 1,440 minutes (24 hours) to the end time before the difference is taken.
  • The calculation ignores time zones and dates beyond the clock times entered, so it never changes daylight-saving rules.

Formula Used

elapsedMinutes = (endHour × 60 + endMin + nextDay × 1440) − (startHour × 60 + startMin) elapsedMinutes = elapsedMinutes + 1440 when the result would be negative hours = floor(elapsedMinutes ÷ 60) minutes = elapsedMinutes mod 60 decimalHours = round(elapsedMinutes ÷ 60 × 100) ÷ 100
Embed this calculator on your website

Add this embed page to your site — visitors use the calculator right from your page.

How long is the gap between 9:00 in the morning and 5:00 in the evening? Eight hours, obviously — but what about 9:15 to 5:05, or 11:00 PM to 6:30 AM, or that meeting that started at a quarter to four? The Time Duration Calculator answers every variant instantly: the exact duration in hours and minutes, the total in minutes, and the same duration written as decimal hours for timesheets and payroll.

Why Clock Math Needs a Calculator

Subtracting clock times is simple in principle and fiddly in practice. The minutes of the end time can be smaller than the minutes of the start time, forcing a borrow of one hour; the end hour can fall numerically below the start hour when an interval crosses midnight; and the result often needs to be restated in different units for different purposes. A duration of 495 minutes is a true fact, but very few people recognize it as eight hours and fifteen minutes without doing the arithmetic. Automating the conversion removes most bookkeeping errors from schedules, invoices, shift planning and travel plans.

How the Calculator Computes the Duration

Internally, every time is first converted into a single minute count: the hour is multiplied by 60 and the minutes are added. Nine in the morning becomes 540 minutes after midnight; five in the evening becomes 1,020. The difference between the two minute counts is the elapsed time to the minute. If that difference is negative — the situation where the end clock time is numerically earlier than the start, as with 23:00 to 02:00 — a full day of 1,440 minutes is added automatically, since the only sensible reading of such a pair is that the interval crossed midnight. From the minute difference, the outputs are derived by division and rounding: whole hours are the difference divided by 60 and rounded down, the leftover minutes are the remainder, and decimal hours are the difference divided by 60 and rounded to two decimal places.

Same Day or Overnight?

The interval selector decides whether the end time belongs to the same calendar day as the start time or to the following one. A shift from 14:00 to 22:00 is a same-day interval; a night shift from 22:00 to 06:00 ends the next day and uses the overnight option. In the overnight case, the calculator adds 1,440 minutes to the end time before computing the difference, which is equivalent to moving the end time onto the next calendar day. Without that explicit switch the tool must guess whether 23:00 to 02:00 means a three-hour overnight stretch or an impossible backwards interval — so the choice is left to you, and the automatic correction only kicks in as a safety net for plain same-day inputs.

Reading the Results

The total duration in minutes is the primary result, the exact figure on which all others depend. Next to it, the calculator shows whole hours and leftover minutes, which is the most natural form for everyday communication: three hours and twenty-five minutes. Finally, decimal hours expresses the same span as a single number — 3.42 hours — the format time-tracking software and payroll systems expect. Six minutes become 0.10 hours, fifteen minutes become 0.25, and thirty become 0.50. The decimal figure is rounded to the hundredth of an hour, so its display value is never off by more than eighteen seconds.

Why Decimal Hours Matter

Billing and payroll round their numbers in decimals, not in clock units. A contractor who works 7 hours and 40 minutes needs 7.67 hours on the invoice; an employee tracking thirty hours over four shifts needs the daily entries in tenths. The decimal-hours output removes the manual conversion that so often introduces errors — a single 7:45 shift quietly misbilled as 7.45 hours rather than 7.75 loses half an hour per iteration. Because the figure is derived from the same minute count as the other readouts, the hours-plus-minutes view and the decimal view always agree with each other.

Overnight Duration as a Mindset Change

A surprising number of practical intervals touch midnight. Shifts, airline redeyes, production windows that must finish before a deadline, support rotations and studios all routinely start one day and end the next. The same raw clock pair describes either a few hours across midnight or an error, and the distinction comes down to the user's intent. The treatment splits the difference cleanly: the same-day mode corrects a negative result by adding a day, while the overnight mode commits the end time to the next day upfront and counts the full 24 hours when the times themselves are identical. Overnight from 21:00 to 09:00 — twelve hours; same-day from 09:00 to 21:00 — also twelve hours, but from a different perspective of the day boundary.

Tricks With the Minute Dial

Because minutes are entered as a separate field from 0 to 59, the calculator exposes patterns worth knowing. Rounding an interval to quarter hours is easy: 9:00–12:15 is precisely 3.25 hours. Unusual but valid timings like 23:59 to 00:01 produce a sensible two-minute result, demonstrating that the engine never depends on the names of the hours but only on the counts. Playing with pairs just below the hour boundary — 10:59 to 11:01, two minutes — is the fastest way to internalize why borrow and carry logic matters and why a calculator beats mental math for the ends of an hour.

Where Durations Are Used

Time-duration arithmetic sits underneath time tracking, travel planning, project schedules, class timetables and facility bookings. Team leads use it at the end of every month to aggregate logged hours; travel planners use it to check connection windows; coaches and studios use it to allocate session time. Because the calculator reports the same span in minutes, in hours and minutes, and in decimal hours, the one tool covers all the formats those different workflows require — no manual conversion step anywhere.

For the wider timeline perspective, pair this tool with the date calculator when you need the distance between whole dates, or with the hours calculator for cumulative weekly time. This tool focuses tightly on the single interval between clock-face times, which keeps the inputs clean: no seconds, no calendar dates, no time zone.

Reading the Clock, 24-Hour Style

All inputs follow the 24-hour clock, the unambiguous standard for computing and international scheduling. 9 PM becomes 21, 11 PM becomes 23 and 12:30 AM becomes 00:30. The hour slider runs from 0 to 23, and the minutes field from 0 to 59, so there is never a 24th hour or a 60th minute to resolve. That discipline eliminates a whole class of input errors before the arithmetic begins, at the cost of requiring evening conversions that most people make automatically anyway.

Common Mistakes the Calculator Prevents

People routinely make the same small errors when subtracting times by hand. The first is forgetting the borrow: 10:05 minus 9:20 is not one hour and -15 minutes, but 45 minutes. The second is conflating the end-of-hour with the end-of-day: a shift from 23:30 to 00:15 swallowed the midnight comparison, and without the overnight mindset it looks like an impossible interval. The third is mixing formats, comparing 03:00 PM with 14:00 as if both were on the same scale. This calculator removes all three by normalizing each time to a single minute count before any arithmetic happens, so the same engine logic applies whether the two times are a minute apart or nearly twenty-four hours.

There is a counting subtlety as well. A duration is an interval, not a count of instants: from 9:00 to 10:00, one hour elapses even though both endpoints are points on the clock. The tool measures the span between the two points, never the number of clock-face marks between them, so the result for any pair of times is the actual elapsed duration in minutes, guaranteed for the user.

Worked Examples to Try

Try a few combinations to feel the logic. Start at 9:00, end at 17:00, same day: 480 minutes, 8 hours, 0 minutes, decimal 8.00 — the classic office day. Change the end to 17:30 and the decimal becomes 8.50 while the minutes column reads 30: the same duration, two frames. Now start 22:15 and end 01:45 with the overnight option — the duration is 3.5 hours, which reads as 210 minutes. Flip the selector to same-day instead and the calculator auto-adds a day, still reporting 210 minutes because the times themselves imply a midnight crossing. Last, identical times such as 12:00 to 12:00: same day gives zero, while overnight states a full 24 hours thanks to the 1,440-minute adjustment. Each pair shows why the interval selector is a deliberate choice rather than a convenience.

Key Assumptions

  • Time entries use the 24-hour clock with minutes from 0 to 59 and hours from 0 to 23.
  • Same-day intervals expect the end time later than the start; a negative difference is corrected by adding one day (1,440 minutes) automatically.
  • The overnight option adds exactly 1,440 minutes to the end time before the subtraction.
  • Seconds, time zones and daylight-saving transitions are not part of the calculation; the wall clock is the only authority.
An interval is only as good as its boundary definition. Decide whether the end of your interval sits on the same calendar day or the next, and the same two clock times can mean two very different durations — the calculator keeps both readings honest.

FAQs

Related Calculators