Duration Calculator Between Two Times: How It Works
- Duration (H:MM)
- h:mm
- Result
- Duration (decimal hours)
- hours
- Result
- Start time (HH:MM)
- 9
- You entered
A duration calculator between two times works out the exact elapsed time from a start time to an end time, typically showing the result in hours, minutes, and seconds. You enter the start and end times (and optionally the dates if the span crosses midnight or multiple days), and the calculator returns the difference as a clock-independent length of time. This tool is essential for shift planning, travel estimates, cooking timers, and any task where you need to know how long something lasts.
Formula
The core formula converts both times to a common unit (minutes since midnight), subtracts the start from the end, and then converts the result back to hours and minutes. In symbols:
Duration (minutes) = (End_H × 60 + End_M) − (Start_H × 60 + Start_M)
- Start_H – hour of the start time (0–23, 24-hour format)
- Start_M – minute of the start time (0–59)
- End_H – hour of the end time (0–23)
- End_M – minute of the end time (0–59)
If the end time is earlier than the start time (e.g., 23:00 to 01:00), you must add 24 hours (1440 minutes) to the end time to account for crossing midnight. For spans longer than 24 hours, include the date in the calculation or add 1440 minutes for each full day.
Worked Example
Using the default values from the calculator above: start time 9:00, end time 17:30.
- Convert start to minutes: 9 × 60 + 0 = 540 minutes
- Convert end to minutes: 17 × 60 + 30 = 1050 minutes
- Subtract: 1050 − 540 = 510 minutes
- Convert to hours and minutes: 510 ÷ 60 = 8.5 hours, or 8 hours and 30 minutes
The calculator shows 510 minutes, 8:30 as H:MM, and 8.50 decimal hours. This matches the formula output exactly.
When to Use a Duration Calculator
You reach for this tool whenever you need the length of an interval, not the clock time of an event. Common uses include:
- Calculating work hours for a timesheet (e.g., 8:45 AM to 5:15 PM)
- Estimating travel time between departure and arrival
- Measuring cooking or baking times that start and end at specific clock times
- Tracking exercise sessions or study blocks
- Figuring out how long a meeting or event lasted
The result is always a duration—something you can add to another time or compare against a limit. It is not a time of day; 2 hours and 30 minutes is the same regardless of whether it started at 6 AM or 6 PM.
How to Read the Result
The calculator gives three common formats:
- Minutes – the raw total, useful for billing or precise comparisons
- H:MM – hours and minutes, the most intuitive for everyday use (e.g., 8:30)
- Decimal hours – hours as a decimal (e.g., 8.50), commonly used for payroll or scientific calculations
Note that 8.50 decimal hours is not 8 hours and 50 minutes—it is 8 hours and 30 minutes. The decimal part represents a fraction of an hour, so 0.50 × 60 = 30 minutes. This is a frequent source of confusion when reading time cards.
Common Mistakes and How to Avoid Them
Even with a calculator, errors creep in. Watch for these:
- AM/PM mix-ups – 12:00 AM is midnight (0:00), 12:00 PM is noon (12:00). Using a 24-hour format eliminates this entirely.
- Forgetting midnight crossing – If you start at 10 PM and end at 2 AM, the naive subtraction gives −8 hours. Add 24 hours to the end time first.
- Treating decimal hours as minutes – 1.5 hours is 1 hour 30 minutes, not 1 hour 5 minutes. Multiply the decimal by 60 to get minutes.
- Ignoring seconds – For precise measurements (sports timing, scientific experiments), include seconds in both inputs or the result will be off by up to 59 seconds.
- Daylight saving time – If your span crosses a DST change, the clock time difference may not equal the actual elapsed time. For example, on a spring-forward day, 1:00 AM to 3:00 AM is only 1 hour of real time, not 2.
Limitations of the Simple Formula
The basic formula assumes a fixed 24-hour day with no time zone or calendar complications. It fails when:
- The span crosses multiple days and you only enter times, not dates – you must add 1440 minutes per day manually.
- You need elapsed time in months or years – those units vary in length, so a simple subtraction cannot handle them.
- You are working with time zones – the formula treats all times as local; you must convert to UTC first for cross-zone calculations.
- Leap seconds are involved – these are rare and only matter for ultra-precise scientific work.
For most everyday uses, these limitations are irrelevant. If you need to count days, weeks, or months, use a dedicated date calculator instead.
Alternatives and Related Tools
Depending on what you need, other calculators may serve you better:
- Date difference calculator – gives the number of days, weeks, or months between two calendar dates, useful for project deadlines or age.
- Time zone converter – converts a specific clock time from one zone to another, not a duration.
- Stopwatch or timer – measures elapsed time in real time, ideal for live events.
- Spreadsheet formulas – in Excel or Google Sheets, subtracting two time cells and formatting as [h]:mm gives the same result.
If your span is under 24 hours and both times are in the same time zone, the simple duration calculator is the fastest and most accurate choice.
Frequently Asked Questions
How do I calculate the duration between two times that cross midnight?
Add 24 hours (or 1440 minutes) to the end time before subtracting. For example, 10:00 PM to 2:00 AM: convert 10 PM to 22:00 and 2 AM to 2:00, then add 24 to the end hour (2 + 24 = 26), giving 26:00 − 22:00 = 4 hours. Many calculators handle this automatically if you enter the times in 24-hour format.
What is the difference between 8.5 hours and 8:30?
They represent the same duration. 8.5 is decimal hours (8 + 0.5 hours), and 8:30 is hours and minutes (8 hours + 30 minutes). Since 0.5 × 60 = 30, both equal 8 hours and 30 minutes. The decimal format is common in payroll; the colon format is common on clocks and schedules.
Why does my calculator show a negative number for a same-day span?
That happens when the end time is earlier than the start time, which usually means the span crosses midnight. For example, 14:00 to 09:00 gives 9 − 14 = −5 hours. Add 24 hours to the end time (9 + 24 = 33) to get 33 − 14 = 19 hours. If you intended a same-day span, check that you entered the correct AM/PM or 24-hour values.
Can I use this calculator for time zones?
No, not directly. The calculator assumes both times are in the same time zone. If your start and end are in different zones, first convert both to a common reference (like UTC), then subtract. For example, a flight from New York (EST) to London (GMT) requires converting both local times to UTC before finding the duration.
How do I include seconds in the calculation?
Convert everything to seconds: hours × 3600 + minutes × 60 + seconds. Subtract start from end, then convert back to hours, minutes, and seconds. For example, 14:20:30 to 16:45:15 gives (16×3600 + 45×60 + 15) − (14×3600 + 20×60 + 30) = 60315 − 51630 = 8685 seconds = 2 hours, 24 minutes, 45 seconds.
What is the best format for payroll hours?
Most payroll systems use decimal hours because they are easier to multiply by an hourly rate. For instance, 8 hours and 30 minutes becomes 8.50 hours. To convert minutes to a decimal, divide by 60 (30 ÷ 60 = 0.50). Always check whether your employer rounds to the nearest quarter-hour or uses exact minutes.
Related
Formula used
in start_h | Start time (HH:MM) | - | 9 | 0 in end_h | End time (HH:MM) | - | 17 | 0 in start_m | Start minutes | - | 0 | 0 in end_m | End minutes | - | 30 | 0 out diff_min | Duration | minutes | (end_h * 60 + end_m) - (start_h * 60 + start_m) | 0 out diff_hm | Duration (H:MM) | h:mm | (end_h * 60 + end_m) - (start_h * 60 + start_m) | time out diff_h | Duration (decimal hours) | hours | ((end_h * 60 + end_m) - (start_h * 60 + start_m)) / 60 | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.