Time Duration Calculator

Find the duration between two times, including overnight spans.

Results

Duration -
Total Minutes -
Total Seconds -

What is Time Duration?

Time duration is the length of time that passes between a start time and an end time. It comes up constantly: figuring out work hours, sleep, travel time, or how long until an appointment. This free time duration calculator finds the exact hours and minutes between two clock times, including the overnight case where the end time falls on the following day.

How to Use This Calculator

  1. Enter the start time in 24-hour HH:MM format (09:15 for 9:15 AM, 17:45 for 5:45 PM); most browsers offer a built-in time picker.
  2. Enter the end time the same way.
  3. Leave the "Assume next day" box checked when the end time falls after midnight, such as a night shift from 10:30 PM to 6:15 AM.
  4. Click "Calculate Duration" to see the elapsed time in hours and minutes, along with the totals in minutes and seconds.

If the box is unchecked and the end time is earlier than the start time, the calculator shows the absolute difference, as if both times fell on the same day.

How to Calculate Hours Between Two Times by Hand

The math behind this calculator is straightforward once you convert both clock times into minutes after midnight:

Duration (minutes) = (End hour × 60 + End minute) − (Start hour × 60 + Start minute)

  • End hour, End minute — the end time in 24-hour format.
  • Start hour, Start minute — the start time in 24-hour format.
  • If the result is negative because the end time is on the next day, add 1,440 (the number of minutes in 24 hours).

To convert the answer back, divide by 60: the whole part is the hours and the remainder is the leftover minutes.

Example 1: A Same-Day Span

How many hours are there from 9:15 AM to 5:45 PM? First rewrite 5:45 PM in 24-hour time as 17:45, then:

  • 9:15 AM → 9 × 60 + 15 = 555 minutes
  • 5:45 PM → 17 × 60 + 45 = 1,065 minutes
  • 1,065 − 555 = 510 minutes
  • 510 ÷ 60 = 8 remainder 30

The duration is 8 hours 30 minutes.

Example 2: Borrowing Across Hours

When the end minutes are smaller than the start minutes, borrow one hour just as you would in ordinary subtraction. For 9:50 AM to 5:20 PM (17:20), the minutes column gives 20 − 50, which is negative. Borrow 1 hour from the 17, turning 17:20 into 16:80. Now 80 − 50 = 30 minutes and 16 − 9 = 7 hours, so the duration is 7 hours 30 minutes.

Crossing Midnight: Overnight Durations

When a shift, flight, or night of sleep runs past midnight, the end time is numerically smaller than the start time even though it happens later. The fix: add 24 hours to the end time before subtracting — exactly what the "Assume next day" checkbox does.

Example 3: An Overnight Shift

From 10:30 PM to 6:15 AM the next morning:

  • 10:30 PM → 22 × 60 + 30 = 1,350 minutes
  • 6:15 AM → 6 × 60 + 15 = 375 minutes
  • 375 − 1,350 = −975 minutes
  • −975 + 1,440 = 465 minutes

The shift lasts 7 hours 45 minutes.

Converting Hours and Minutes to Decimal Hours

Payroll systems almost always pay in decimal hours rather than hours and minutes, so a timesheet entry like 8 h 30 m must be converted before multiplying by an hourly wage:

Decimal hours = Hours + (Minutes ÷ 60)

For example, 8 hours 30 minutes becomes 8 + 30 ÷ 60 = 8.5 hours, and 7 hours 45 minutes becomes 7 + 45 ÷ 60 = 7.75 hours. At $20 per hour, those shifts pay $170.00 and $155.00 respectively. Use this table for quick conversions:

MinutesDecimal HoursMinutesDecimal Hours
:000.00:300.50
:050.08:350.58
:100.17:400.67
:150.25:450.75
:200.33:500.83
:250.42:550.92

Deducting Unpaid Breaks

To find paid time, subtract any unpaid breaks from the total duration. Suppose you work from 9:00 AM to 5:30 PM with an unpaid 45-minute lunch:

  • 9:00 AM to 5:30 PM = 8 hours 30 minutes total
  • 8 h 30 m − 45 minutes = 7 hours 45 minutes paid, or 7.75 hours in decimal form

To total several clock-in and clock-out pairs or a full week with breaks and overtime, use the Time Card Calculator or the Hours Calculator.

12-Hour vs 24-Hour Time Formats

The 12-hour clock reuses the numbers 1 through 12 twice a day, so AM and PM markers are essential; the 24-hour clock counts from 00:00 (midnight) to 23:59 and gives every moment a unique label, which is why payroll software, airlines, and hospitals prefer it. To convert a PM time (other than noon), add 12 to the hour: 1:00 PM is 13:00 and 10:30 PM is 22:30. Noon is 12:00 PM; midnight is 12:00 AM, written 00:00. AM times just take a leading zero, so 6:15 AM is 06:15. Using 24-hour input removes the AM/PM mix-ups that commonly cause timesheet errors.

Frequently Asked Questions

How does the next-day option work?

If the end time is earlier than the start time and the checkbox is enabled, the calculator assumes the end time is on the following day and adds 24 hours before subtracting. With the checkbox off, it shows the absolute difference between the two times, treating them as if both happened on the same day.

How do I calculate hours between two times that cross midnight?

Convert both times to minutes after midnight, add 1,440 to the end time if it is earlier than the start time, then subtract. For 10:30 PM to 6:15 AM that is 375 − 1,350 + 1,440 = 465 minutes, or 7 hours 45 minutes.

How do I convert hours and minutes to decimal hours for payroll?

Divide the minutes by 60 and add the result to the whole hours. A shift of 8 hours 30 minutes is 8.5 hours, and 7 hours 45 minutes is 7.75 hours. The reference table above lists decimal equivalents for every 5-minute increment.

Can I use this calculator for work shifts?

Yes, it works for any shift, including overnight shifts that cross midnight. To total a full week of clock-in and clock-out times with break deductions and overtime, use our Time Card Calculator.

What time format should I use?

Enter times in 24-hour HH:MM format — for example, 17:45 for 5:45 PM. Most browsers show a built-in time picker, so you can also pick the time from a clock or dropdown instead of typing it.

What is the longest duration the calculator can show?

23 hours 59 minutes — the longest span that fits when the end time falls on the same or the following day. For spans longer than 24 hours, use the Date Calculator or Day Counter, which measure elapsed time across calendar dates.

Does it handle seconds?

The inputs use minute precision, but the results include the total duration in seconds (the total minutes multiplied by 60) for quick reference.