Use this free time duration calculator to find the exact elapsed time between any two clock times - in hours, minutes, and seconds. Whether you are using this time duration calculator online for tracking shifts or timing events, our time calculator duration tool helps you determine the exact difference between any start and end time.
How to use this time duration calculator
All times are entered in 24-hour format. 9:00 AM is 09:00, and 9:00 PM is 21:00. If you are more comfortable with 12-hour AM/PM times, convert first: add 12 to any PM hour except 12 noon itself, and then let our time duration calculator online solve it.
How to calculate time duration
Learning how to calculate duration of time values becomes easier once you stop thinking about them as "hours and minutes" and start thinking about them as total seconds since midnight. Converting both times to a single seconds value is the standard method for calculating duration of time ranges, reducing a complex clock subtraction into a simple single-number problem.
The conversion formula
For any time H:MM:SS, the total seconds since midnight is: H x 3600 + M x 60 + S. This gives a single integer between 0 (midnight) and 86,399 (one second before midnight). Once both times are in this form, the duration in seconds is simply: end seconds - start seconds.
Handling overnight spans
When the end time is earlier in the day than the start time - a night shift, a flight route, or a late-evening event - the naive subtraction produces a negative number. The fix is straightforward: add 86,400 seconds (24 hours) to the end time before subtracting. This correctly models the fact that the end time falls on the following calendar day.
For example, a shift from 22:00 to 06:00: end seconds = 6 x 3600 = 21,600. Since 21,600 is less than 22 x 3600 = 79,200, add 86,400: 21,600 + 86,400 = 108,000. Duration = 108,000 - 79,200 = 28,800 seconds = exactly 8 hours.
The time duration formula
Converting duration to decimal hours
Decimal hours = total seconds / 3600. This format is used in payroll, billing, and any context where arithmetic on times is needed. 2 hours 30 minutes = 9,000 seconds / 3600 = 2.5 decimal hours. Multiplying by an hourly rate gives exact earnings without needing to handle minutes separately.
What is time duration and why does it matter?
Time duration is the amount of time that has elapsed between a start point and an end point. It is a fundamental concept used in almost every field: medicine (procedure length, dosing intervals), payroll (shift hours for compensation), aviation (flight times), sports (race and event timing), project management (task timelines), and everyday scheduling.
While duration seems simple, clock arithmetic has a non-obvious complication: hours and minutes are base-60 units, not base-10. You cannot add or subtract times the same way you add regular numbers. 8:45 + 0:30 is not 8:75 - it is 9:15, because 75 minutes wraps around to 1 hour and 15 minutes. Converting to total seconds eliminates this problem entirely by working in a consistent base unit.
The secondary output - decimal hours - is particularly practical. Payroll systems, legal billing, and contractor invoices nearly all use decimal hours. Knowing that a 7-hour, 45-minute shift is 7.75 hours makes multiplication by hourly rate straightforward.
Understanding your time duration result
Hours, minutes, and seconds
The classic clock format. Easiest for human communication - "the meeting ran for 1 hour and 23 minutes" is immediately understood by everyone. Use this for scheduling, planning, and any communication context.
Total minutes
The full duration expressed in minutes with no remainder. Useful for calculating data rates (megabytes per minute), cooking times, medication dosing intervals, and any formula based on a per-minute rate.
Total seconds
The most granular unit. Used in sports timing, video editing (frames), scientific experiments, and computing (log timestamps). For two times entered without seconds, this is always a multiple of 60.
Decimal hours
Hours expressed as a decimal fraction. Multiply by your hourly rate to get pay or billing. Multiply by fuel consumption per hour to get fuel used. This is the most versatile format for any rate-based calculation.
Time duration examples: using the calculator time duration tool
Example 1 - Work shift
Start: 09:00 - End: 17:30
Start seconds: 9 x 3600 = 32,400. End seconds: 17 x 3600 + 30 x 60 = 61,200 + 1,800 = 63,000.
Duration: 63,000 - 32,400 = 30,600 seconds.
Result: 8 hours, 30 minutes (8.5 decimal hours)
Example 2 - Night shift (overnight)
Start: 22:00 - End: 06:00
End is before start - add 86,400: 6 x 3600 + 86,400 = 108,000. Start: 22 x 3600 = 79,200.
Duration: 108,000 - 79,200 = 28,800 seconds.
Result: 8 hours, 0 minutes (crosses midnight)
Example 3 - Precise timing with seconds
Start: 14:23:45 - End: 16:07:12
Start: 14 x 3600 + 23 x 60 + 45 = 51,825. End: 16 x 3600 + 7 x 60 + 12 = 57,432.
Duration: 57,432 - 51,825 = 5,607 seconds.
Result: 1 hour, 33 minutes, 27 seconds (93.45 total minutes)
Quick tips for time calculations
Common time calculation mistakes
Treating minutes like a base-10 decimal
8:45 + 0:30 is not 8.75 hours - it is 9:15, or exactly 9.25 hours. Working in total minutes or total seconds eliminates this confusion because you are back in a linear number system where normal arithmetic applies.
Forgetting to account for overnight spans
A shift from 10 PM to 6 AM is 8 hours, not -16 hours. If your end time is before your start time and you are not accounting for the midnight crossing, your result will be wrong. This calculator handles it automatically with a note when the span crosses midnight.
Confusing duration with clock time
A duration of 2:30 means 2 hours and 30 minutes of elapsed time. A clock time of 2:30 means 2:30 AM. They look identical but mean completely different things. Always be clear about whether a value is a clock time (a point in the day) or a duration (a span of time).
Using decimal hours as clock time
2.5 decimal hours means a duration of 2 hours and 30 minutes. It does not mean 2:50 on the clock. 0.5 hours = 30 minutes, not 50 minutes. This mix-up is common in payroll corrections and timesheet disputes.
By using our dedicated time duration calculator, you can avoid these common clock math mistakes and calculate precise elapsed time spans instantly.