Time & Date

Time Difference Calculator

Enter a start time and an end time to calculate the exact duration between them — including shifts that run past midnight into the next day.

Start and end time

Duration
Enter both times to calculate.

How the Time Difference formula works

Duration in minutes, converted to hours and minutes:

Duration (minutes) = End time − Start time (add 24 hours if the end time is earlier, i.e. crosses midnight)
Hours = floor(Duration / 60)
Minutes = Duration mod 60

Step-by-step calculation

  1. Convert both the start and end times to minutes since midnight.
  2. Subtract the start from the end.
  3. If the result is negative, add 24 hours (1,440 minutes) to account for crossing midnight.
  4. Convert the total minutes back into whole hours and remaining minutes.

Worked example

A shift from 10:30 PM to 6:15 AM: since the end time is earlier in the clock, it crosses midnight. Duration = (6:15 + 24:00) − 22:30 = 7 hours 45 minutes.

Frequently asked questions

How do I calculate a shift that crosses midnight?

Just enter the start and end times as shown on the clock — the calculator automatically detects when the end time is earlier than the start time and adds a full day to account for the overnight crossing.

How is this different from the Time Card Calculator?

This calculator finds the duration between a single start and end time. The Time Card Calculator sums multiple days of hours (already totaled) across a week, including overtime pay calculations.