Time Duration Calculator
Measure how much time sits between a start and an end — two clock times in a day, a shift running past midnight, or two full date-times days apart. This page measures elapsed time. If you want to add four hours to a clock reading rather than measure between two of them, that is the Time Calculator.
Type times in 12h (9:30 pm) or 24h (21:30). An end that lands before the start is read as crossing midnight.
Your duration will appear here
Enter a start and end time to see the time between them, including spans that cross midnight.
Elapsed Time, Not Clock Readings Counted
This is the ambiguity behind most disputes over a timesheet, and it has a name: inclusive versus exclusive counting.
Exclusive counting measures the gap. A shift from 09:00 to 17:00 is 8 hours of elapsed time. That is what this calculator returns, and it is what you are paid for.
Inclusive counting counts the endpoints. Count the clock hours the shift touches — 9, 10, 11 and so on through 17 — and you get nine numbers. The same shift, described two ways, differing by one.
For time this is rarely what anyone wants, which is why elapsed time is the default here. It matters far more for days, where “a 5-day booking” and “5 nights” genuinely differ, and where a deadline may or may not include the final day. That is a calendar question rather than a clock one — the date calculator and the days between dates calculator both offer an explicit “include the end date” option for exactly this reason.
One consequence worth knowing: a start and end that are the same, 09:00 to 09:00, is zero elapsed time by default, not 24 hours. If you meant a full day, say so with the overnight option, which reads it as 24 hours instead.
Overnight Spans and Backwards Times
A clock time on its own does not say which day it belongs to, so 22:00 to 06:00 could mean eight hours or a negative number, depending on what you meant. This calculator resolves it one way, deliberately.
An end earlier than the start is treated as crossing midnight. 22:00 to 06:00 returns 8 hours, which is what a night shift actually is. Nothing is reported as negative.
That means you cannot get a negative duration by reversing the inputs. Enter 17:00 as the start and 09:00 as the end and the answer is 16 hours, not minus eight — the calculator assumes you meant the following morning. If you wanted the eight-hour gap, put the earlier time first. This is a real trap when transcribing a timesheet in the wrong order: the result is plausible, and wrong.
For a span genuinely running over more than one night, switch to the two date-time mode, where the dates carry the day and no assumption is needed.
Which time tool?
- Measuring between two times — you are in the right place.
- Adding or subtracting a span — “what time is it four and a half hours after 22:30?” — use the Time Calculator.
- A week of shifts, with breaks and overtime — use the Time Card Calculator, which totals a timesheet rather than one span.
- Whole days, months or years apart — use the Date Calculator.
Which time tool should you use?
- Want to add or subtract lengths of time instead of measuring a gap? Use the Time Calculator.
- Working out hours worked with a break deducted and decimal hours? Use the Hours Calculator.
Quick Answer
This calculator measures the difference between two points in time. Give it a start and an end and it returns the length in hours and minutes, handling spans that cross midnight, with an option for two full date-times when the gap runs across days.
How It Works: Formula & Variables
Duration = End − Start (if End < Start, add 24:00)
- Convert to 24h
- Add 12 to any PM time before subtracting.
- Borrow minutes
- If the minutes go negative, take 60 from the hours column.
- Across midnight
- When the end falls on the next day, add a full 24 hours.
Worked Examples
Example 1: A standard shift
09:00 to 17:30 is 8 hours 30 minutes, or 8.5 hours as a decimal, which is the form most payroll systems want. Subtract an unpaid 30-minute break and you are paid for 8 hours.
Example 2: A night shift crossing midnight
22:00 to 06:00 is 8 hours. The end reading is smaller than the start, so it is read as the next morning rather than as a negative span. No date entry is needed for a single overnight shift.
Example 3: Times entered the wrong way round
Enter 17:00 as the start and 09:00 as the end and you get 16 hours, because the calculator assumes the following morning. If you meant the 8-hour daytime gap, the earlier time goes first. The answer is never negative, so a transposed pair looks perfectly reasonable — worth a second look whenever a total comes out roughly twice what you expected.
Example 4: A part-hour span for billing
14:15 to 17:45 is 3 hours 30 minutes, or 3.5 decimal hours. Billing in whole hours would round that to 4, and billing in six-minute units to 3.5 exactly — the rounding rule is your contract’s, not the clock’s, so the calculator gives you the true elapsed figure to round yourself.
Key Concepts
Midnight is the tricky part: When a span runs overnight, the raw subtraction would go negative. Adding 24 hours puts it right, which is exactly what the tool does when the end reads earlier than the start.
12-hour clocks need care: 12 AM is midnight and 12 PM is noon. Getting those two backwards throws the whole span off by twelve hours.
A duration is not the same as hours worked: This tool gives the raw gap. It does not take out a lunch break — that is what the Hours Calculator adds.
Common Mistakes
Ignoring the midnight crossing: Subtracting straight through gives a negative, when the real answer wraps into the next day.
Converting AM and PM wrong: 12 AM is midnight and 12 PM is noon, which is easy to flip.
Treating the gap as worked hours: A duration does not subtract breaks — reach for the Hours Calculator when you need that.
Frequently Asked Questions
Enter a start time and an end time and the calculator returns the length between them in hours and minutes, along with the equivalent in decimal hours.
When the end time is earlier than the start, the tool reads it as landing on the next day and adds 24 hours. So 8:00 PM to 5:00 AM comes out as 9 hours rather than a negative number.
For a clock difference the result is an absolute length, so putting the later time first does not change the answer.
Yes. The "Two date-times" tab takes a full start and end date and time and returns the gap in days, hours, minutes, and seconds.
Both work. You can type 9:30 pm or 21:30, and the calculator converts anything with PM by adding 12 hours before it does the math.
This tool measures the gap between two points in time. The Time Calculator adds and subtracts lengths of time, such as 2 hours plus 3 hours.
Related Calculators
Time Calculator
Add and subtract lengths of time instead of measuring the gap between two times.
Hours Calculator
Get hours worked with a break deducted and decimal hours for payroll.
Date Calculator
Work with calendar dates — the gap between two, or adding and subtracting units.
Time Card Calculator
Build a full weekly timesheet with overtime and gross pay.