Time Calculator
Add or subtract hours and minutes from a time, calculate the gap between two times, or total up multiple durations — overnight shifts handled automatically.
Operation
How to Use
This tool has three modes. Switch between them using the tabs at the top. "Add / Subtract" lets you add or subtract a duration from a given time — for example, what time is it 2 hours 45 minutes after 13:30, or 90 minutes before the current time? Enter the starting time (hours and minutes), the amount to add or subtract (hours, minutes, and optionally seconds), choose Add or Subtract, and the result appears instantly.
"Time Difference" calculates how many hours and minutes lie between two times. This is the go-to mode for working out shift lengths, meeting durations, or any elapsed time. Just enter a start time and an end time. If the end is earlier than the start, the tool automatically treats it as an overnight calculation — perfect for night shifts.
"Sum Durations" adds up multiple time spans and gives a grand total. Use it to add up video runtimes, task times throughout the day, or study sessions across a week. Click "Add row" to include up to 10 rows. The total can exceed 24 hours, and the tool displays it correctly as, say, 25 h 30 m rather than wrapping back to 1 h 30 m.
How the Math Works
Time arithmetic is tricky because it uses base-60 (sexagesimal) rather than base-10 (decimal). In everyday counting, 9 + 1 = 10. In time, 59 minutes + 1 minute = 1 hour 0 minutes — a carry happens at 60, not 100. This mismatch is the leading cause of time-calculation errors in spreadsheets: a formula like =A1+B1 in Excel adds decimal fractions of a day, and rounding errors creep in. This tool sidesteps the problem entirely by converting every time value to a plain integer (total seconds), doing the arithmetic in whole numbers, and converting back to hours, minutes, and seconds at the end.
Overnight handling uses the modulo operation. One full day is 86,400 seconds (24 × 60 × 60). After adding or subtracting, the result in seconds is taken modulo 86,400 to get the clock time, and the integer quotient gives the day offset. For example, 23:50 + 20 min = 23 × 3600 + 50 × 60 + 20 × 60 = 87,000 seconds. 87,000 mod 86,400 = 600 seconds = 00:10, and the quotient 1 means the result falls on the next day: 00:10 next day. For the time-difference mode, when the end time is earlier than the start time (e.g., start 22:00, end 06:00), 86,400 seconds is added to the end before subtracting: (6 × 3600 + 86400) − 22 × 3600 = 28,800 seconds = 8 hours. No date juggling required.
The Sum Durations mode does not apply the modulo — totals above 86,400 seconds (24 hours) are kept as-is. This means 12 hours + 13 hours 30 minutes correctly returns 25 hours 30 minutes rather than 1 hour 30 minutes. The Add / Subtract and Time Difference modes do normalize to within a single day, because the result is a clock time, not a duration.
FAQ
- Do I have to fill in the seconds field?
- No. Leave it blank and it defaults to zero. Most everyday calculations — shift times, meeting lengths, travel time — only need hours and minutes, so you can ignore the seconds field entirely.
- Can it handle overnight shifts, like 10 PM to 6 AM?
- Yes, automatically. In "Time Difference" mode, enter start 22:00 and end 06:00. Because the end time is earlier than the start, the tool recognizes this as an overnight span and returns 8 hours. You don't need to enter dates or toggle any settings.
- Why is time calculation in Excel sometimes wrong?
- Excel stores times as fractions of a day (1.0 = 24 hours) and uses floating-point arithmetic, which introduces tiny rounding errors that can accumulate. It also rolls over at midnight rather than carrying the overflow to a "day" column, which surprises users doing overnight sums. This tool converts everything to whole-number seconds first, so there are no floating-point errors and overnight wrap-around is handled explicitly with a clear day-offset label.
- Can the total in Sum mode exceed 24 hours?
- Yes. Unlike a clock that resets at midnight, the sum mode accumulates without wrapping. Add twelve 2-hour blocks and you get 24 hours; add one more and you get 26 hours. This makes it suitable for totaling weekly training hours, project time logs, or any multi-day accumulation.