Time Difference Calculator
Work out how long there is between two times of day, including a shift that runs past midnight. Subtract an unpaid break and read the answer in hours and minutes or as decimal hours. Runs in your browser.
- Free, no sign-up
- REST + MCP
- Updated
- Reviewed by Olgun Ozoktas
Why Use Our Time Difference Calculator?
Subtracting two clock times is easy until the clock resets. From 09:00 to 17:30 the arithmetic is what you expect. From 22:00 to 06:00 it is not: the end is a smaller number than the start, and the plain subtraction gives minus sixteen hours rather than eight.
The fix is to notice that the end fell on the next day and add twenty-four hours. This page does that automatically, and the setting that controls it has three positions rather than a checkbox because the three cases are genuinely different. Auto wraps only when the end is not after the start. Always treats the end as being on the next day whatever the numbers say, so 09:00 to 17:00 becomes thirty-two hours. Never refuses to wrap at all and tells you the times look reversed.
One case is worth stating because a lot of calculators get it wrong: two identical times. A shift from 09:00 to 09:00 is twenty-four hours, not zero. Returning zero would silently lose a whole day from a timesheet, which is the kind of error nobody catches until payroll.
The other quiet trap is the twelve-hour clock. 12:00 am is midnight and 12:00 pm is noon — neither is twelve o'clock plus an offset, and adding twelve to the hour gets both of them wrong. Both are handled.
Decimal hours sits under the main answer because it is what the next step usually needs. Eight hours and thirty minutes is 8.5 on a timesheet, not 8.3, and that particular slip is common enough to be worth removing.
How it compares
A spreadsheet can do this with a formula that handles the midnight wrap, which is a formula most people look up each time. A phone's clock app gives a stopwatch, not a subtraction between two times you already know.
On FindUtils, Date Difference Calculator is the tool to use when the two moments are on different dates — it takes full date-times and returns years down to seconds. This page is for the case where there is no date at all, only two readings from a clock. If you need a whole week of entries with overtime and pay, Timesheet Calculator is the one.
Time Difference Tips
- Auto is right almost always: it wraps only when the end is not after the start, which is exactly when a shift ran overnight.
- Two equal times mean a full day, not zero. A 09:00 to 09:00 shift is 24 hours, and returning zero would silently lose a day.
- Decimal hours is what payroll and invoicing use: 8h 30m is 8.5, not 8.3.
- Set Past midnight to Always when both times are on the clock but the end really is the next day — 09:00 to 17:00 then reads as 32 hours.
- Never refuses to wrap and reports an error instead, which is useful when you want to be told you typed the times the wrong way round.