Time Difference Calculator
Enter a start time and an end time to find the exact duration between them. The calculator shows the difference in hours, minutes and seconds, plus a decimal-hours figure useful for payroll and timesheets. It handles spans that cross midnight automatically, and a "show your work" panel walks through every step of the arithmetic.
How the calculator works
The calculator converts both times into a count of seconds measured from midnight (00:00:00). It then subtracts the start value from the end value and, if you toggled "crosses midnight", adds 86,400 seconds (one full day) so that a night shift such as 22:00 to 06:00 comes out at 8 hours rather than -16 hours. Any break deduction you enter is subtracted last. The final total is then split back into whole hours, remaining minutes and remaining seconds, and also expressed as a single decimal-hours figure, which most payroll and billing systems expect.
Decimal hours and payroll
Clocks show time in a sexagesimal system (base 60), but spreadsheets, invoices and payroll software normally expect decimal numbers. To convert, divide the total elapsed seconds by 3,600. A 7-hour 30-minute shift becomes 7.5 decimal hours; 6 hours 45 minutes becomes 6.75. This calculator does that conversion automatically. If you need to reverse the process, multiply the decimal part by 60: 0.75 hours x 60 = 45 minutes.
Handling midnight crossings
When a shift, flight, or event starts before midnight and ends after it (for example, 23:00 to 07:30), the naive subtraction gives a negative number. Enabling the "crosses midnight" option adds exactly 24 hours to the result, producing the correct 8-hour 30-minute answer. If your span is longer than 24 hours, use a date-and-time calculator that accepts full calendar dates instead.
Break deductions and net work time
Labor law in most countries distinguishes between "clock-on" hours and the net paid time after unpaid rest periods. A common example is a 9-to-5 shift with a 30-minute unpaid lunch: gross duration is 8 hours, net paid time is 7 hours 30 minutes. Enter the break length in minutes in the "Break / deduction" field and the calculator subtracts it from the gross span, showing the net duration you actually need to record on a timesheet.
Quick time unit conversions
| Unit | Seconds | Minutes | Hours |
|---|---|---|---|
| 1 minute | 60 | 1 | 0.01667 |
| 1 quarter hour | 900 | 15 | 0.25 |
| 1 half hour | 1 800 | 30 | 0.5 |
| 1 hour | 3 600 | 60 | 1 |
| 1 shift (8 h) | 28 800 | 480 | 8 |
| 1 day | 86 400 | 1 440 | 24 |
Reference for converting between common time units.
Frequently asked questions
How do I calculate the time difference between two times?
Convert each time to seconds from midnight (hours x 3,600 + minutes x 60 + seconds), subtract the smaller from the larger, then convert back. For example, 09:00 = 32,400 s and 17:30 = 63,000 s; 63,000 - 32,400 = 30,600 s = 8 hours 30 minutes.
What is decimal hours and why is it used?
Decimal hours express a duration as a single decimal number rather than hours-and-minutes. You get it by dividing total seconds by 3,600 (or total minutes by 60). It is the standard format for timesheets, invoices, and most payroll software because it is easy to multiply by an hourly rate.
How do I calculate time across midnight?
Subtract the start time from the end time in seconds. If the result is negative (because the end is earlier in the day than the start), add 86,400 seconds (24 hours). For a shift from 22:00 to 06:00: 6 x 3600 - 22 x 3600 = 21,600 - 79,200 = -57,600; add 86,400 to get 28,800 s = 8 hours.
How do I subtract a break from worked hours?
Calculate the gross time span first, then subtract the break duration in seconds. For a 9:00-17:30 shift with a 30-minute break: gross = 8.5 hours = 30,600 s; break = 1,800 s; net = 30,600 - 1,800 = 28,800 s = 8 hours. Enter the break length in the "Break / deduction" field and this calculator handles it automatically.
What is the difference between total minutes and minutes in the breakdown?
Total minutes is the entire duration expressed as one number (for example, 510 for 8 hours 30 minutes). "Minutes" in the hours-minutes-seconds breakdown is only the remaining minutes after the whole-hour portion has been removed (so 30 for 8 h 30 m). Use total minutes when you need a single value for further calculations.
Can I use this for longer spans, like days?
This calculator is designed for within-day or overnight (crossing midnight once) time spans. If your event lasts more than 24 hours, you need to enter dates as well as times. Use a date duration calculator that accepts full calendar dates for multi-day spans.