Time Difference Calculator - Subtract Time, Find the Gap

    Two clock readings, one answer. Enter a start time and an end time, and the calculator returns the gap in HH:MM:SS, decimal hours, and total minutes. Handles overnight shifts that cross midnight.

    Parameters

    Enter data for calculations

    Format: HH:MM (e.g. 08:30)

    Format: HH:MM (e.g. 17:00)

    Use when the time span crosses midnight

    Form progress0 / 2 fields

    💡 Fill in all required fields to unlock the calculate button

    Subtraction works for clock times too

    You clocked in at 08:30 and clocked out at 17:15. How long did you work? This calculator takes two time readings and gives you the gap - in HH:MM:SS, decimal hours (for payroll), and total minutes. If the shift crosses midnight, one checkbox fixes it.

    How to find the time difference - step by step

    1. Start time - enter the earlier time in 24-hour format (e.g. 08:30 for half past eight in the morning).
    2. End time - enter the later time (e.g. 17:15 for quarter past five in the afternoon).
    3. Crosses midnight? - if the end time is the next day (e.g. night shift from 22:00 to 06:00), tick the checkbox.
    4. Read the result - the difference appears in three formats: HH:MM:SS, decimal hours, and total minutes.

    The midnight problem - and how the calculator solves it

    Without the checkbox
    Start: 22:00, End: 06:00
    Result: error - end time appears earlier than start time. The calculator cannot guess that you mean the next day.
    With the checkbox ticked
    Start: 22:00, End: 06:00, midnight: on
    Result: 08:00:00 (8.00 h, 480 min). Correct - the calculator adds 24 hours to the end time internally.

    Practical examples

    Scenario Start End Midnight? Result
    Office shift 08:30 17:15 No 08:45:00 (8.75 h)
    Night shift 22:00 06:00 Yes 08:00:00 (8.00 h)
    Lunch break 12:00 12:30 No 00:30:00 (0.50 h)
    Full day 00:00 23:59 No 23:59:00 (23.98 h)
    Short meeting 14:00 14:45 No 00:45:00 (0.75 h)
    Late night coding 21:30 02:15 Yes 04:45:00 (4.75 h)
    Same time 10:00 10:00 No 00:00:00 (0.00 h)

    Output formats explained

    Format Example Best for
    HH:MM:SS 08:45:00 Human-readable display, timesheets
    Decimal hours 8.75 h Payroll, billing, spreadsheets (multiply by rate directly)
    Total minutes 525 min Scheduling software, cooking timers, project tracking

    FAQ

    Why do I get an error when the end time is earlier than the start time?
    Without extra context, the calculator assumes both times are on the same day. If the end time is numerically smaller (e.g. start 22:00, end 06:00), it looks like a negative duration. Tick the "crosses midnight" checkbox to tell the calculator that the end time belongs to the next day. It then adds 24 hours internally and gives the correct result.
    Does the calculator use 12-hour or 24-hour format?
    It uses 24-hour format (00:00 to 23:59). If you are used to 12-hour AM/PM format: morning times stay the same (8:30 AM = 08:30), afternoon times add 12 (2:30 PM = 14:30), midnight is 00:00, and noon is 12:00.
    Can I calculate the difference across multiple days?
    This calculator handles single-day and overnight (one midnight crossing) scenarios. For gaps spanning multiple days, use the Date Difference Calculator instead - it accepts full dates and returns the gap in days, hours, and minutes.
    What is decimal hours and why would I use it?
    Decimal hours convert minutes into a fraction of an hour. 8 hours 45 minutes = 8.75 decimal hours. This format is standard in payroll: multiply 8.75 by an hourly rate ($30) and you get $262.50 directly - no extra conversion needed.
    What happens if I enter the same time for start and end?
    The result is 00:00:00 (zero hours, zero minutes). If you intended a full 24-hour shift (e.g. 08:00 to 08:00 the next day), tick the midnight checkbox. With it on, same-time inputs still return 0:00 because the calculator sees no crossing.
    Can I add multiple time differences together?
    This tool calculates one difference at a time. To add several durations (e.g. Monday's hours + Tuesday's hours), use the Time Sum Calculator - it takes up to five entries and returns the total.

    Related tools

    Time Sum Calculator

    Add up to five time durations and get the total in multiple formats - Open calculator

    Day Counter

    Count days remaining to a future date or elapsed since a past event - Open calculator

    Age Calculator

    Calculate your exact age in years, months, and days from date of birth - Open calculator

    Date Difference Calculator

    Find the exact gap between any two dates in days, weeks, and months - Open calculator

    Similar calculators from this section