Working Hours Calculator

A precise calculator to find the total working hours between a start and end time, including breaks. Sum multiple days for a complete timesheet total.

Full original guide (expanded)

Data Source and Methodology

This calculator determines time duration based on standard timekeeping principles. The methodology for time representation and calculation is consistent with international standards for time and date formats.

  • Authoritative Data Source: ISO 8601:2019 (Data elements and interchange formats – Information interchange – Representation of dates and times).
  • Reference: This standard defines the representation of time in a format that avoids ambiguity (e.g., 24-hour notation).

All calculations are performed by converting start and end times into a common unit (total minutes from midnight) to ensure accuracy, especially across overnight shifts. The final result is then converted back into decimal hours and HH:MM format.

The Formula Explained

The core logic involves subtracting the start time and break duration from the end time. To handle all cases, times are first converted to minutes.

1. Convert Times to Minutes:

$ \text{Start (minutes)} = (\text{Start Hour} \times 60) + \text{Start Minutes} $
$ \text{End (minutes)} = (\text{End Hour} \times 60) + \text{End Minutes} $

2. Calculate Gross Duration (handles overnight shifts):

If $ \text{End (minutes)} < \text{Start (minutes)} $, the shift crosses midnight.

$ \text{Duration (minutes)} = (1440 - \text{Start (minutes)}) + \text{End (minutes)} $

Otherwise, for a same-day shift:

$ \text{Duration (minutes)} = \text{End (minutes)} - \text{Start (minutes)} $

3. Calculate Net Total:

$ \text{Net Minutes} = \text{Duration (minutes)} - \text{Break (minutes)} $

4. Convert to Final Formats:

$ \text{Total (Decimal)} = \frac{\text{Net Minutes}}{60} $
$ \text{Total (HH)} = \lfloor \frac{\text{Net Minutes}}{60} \rfloor $
$ \text{Total (MM)} = \text{Net Minutes} \mod 60 $

Glossary of Variables

Variable Description
Start Time The time you began your work shift.
End Time The time you ended your work shift.
Break (minutes) The total duration of any unpaid breaks, entered in minutes.
Total Hours (Decimal) The final work duration expressed as a decimal number (e.g., 7.75). This is the format most commonly used for payroll.
Total Hours (HH:MM) The final work duration expressed in hours and minutes (e.g., 07:45).

How It Works: A Step-by-Step Example

Let's calculate the hours for an employee who works a typical shift.

  • Input Start Time: 8:30 AM
  • Input End Time: 5:15 PM
  • Input Break: 45 minutes

Calculation Steps:

  1. Convert to 24-hour format & minutes:
    • Start Time = 8:30 AM → 8:30 → $ (8 \times 60) + 30 = 510 $ minutes.
    • End Time = 5:15 PM → 17:15 → $ (17 \times 60) + 15 = 1035 $ minutes.
  2. Calculate Gross Duration:
    • The shift is on the same day (1035 > 510).
    • $ \text{Duration} = 1035 - 510 = 525 $ minutes.
  3. Subtract Break:
    • $ \text{Net Minutes} = 525 - 45 = 480 $ minutes.
  4. Format Results:
    • Decimal: $ 480 / 60 = 8.00 $ hours.
    • HH:MM: 480 minutes is exactly 8 hours and 0 minutes, or $ 08:00 $.

Frequently Asked Questions

How does the calculator handle overnight shifts (e.g., 10:00 PM to 6:00 AM)?

The calculator automatically detects overnight shifts. If the End Time is earlier than the Start Time, it assumes the shift crosses midnight and calculates the duration correctly (e.g., 10:00 PM to 6:00 AM is 8 hours).

Can I use 24-hour (military) time?

Yes. The time inputs accept both 12-hour (AM/PM) and 24-hour formats. For example, 5:00 PM and 17:00 are treated as the same time.

What's the difference between decimal hours and HH:MM format?

Decimal hours are used for payroll and billing (e.g., 7.5 hours). HH:MM format is a standard time display (e.g., 07:30). Both represent the same duration. 7.5 decimal hours is 7 and a half hours, which is 7 hours and 30 minutes.

How do I enter my break time?

Enter the *total* duration of your *unpaid* breaks for that day in minutes. For example, a 30-minute lunch and two 15-minute breaks would be 30 + 15 + 15 = 60 minutes.

Can this calculator determine my pay?

This calculator only provides the total hours worked. To calculate your pay, you would multiply the 'Total Hours (Decimal)' result by your hourly wage. We offer a separate salary calculator for that purpose.

How do I add multiple days for a weekly total?

Simply click the "Add Another Day" button. A new row will appear for you to enter the start, end, and break times for another day. The calculator will sum all rows when you click "Calculate".

Last accuracy review:


Audit: Complete
Formula (LaTeX) + variables + units
This section shows the formulas used by the calculator engine, plus variable definitions and units.
Formula (extracted text)
$ \text{Start (minutes)} = (\text{Start Hour} \times 60) + \text{Start Minutes} $ $ \text{End (minutes)} = (\text{End Hour} \times 60) + \text{End Minutes} $
Formula (extracted text)
$ \text{Duration (minutes)} = (1440 - \text{Start (minutes)}) + \text{End (minutes)} $
Formula (extracted text)
$ \text{Duration (minutes)} = \text{End (minutes)} - \text{Start (minutes)} $
Formula (extracted text)
$ \text{Net Minutes} = \text{Duration (minutes)} - \text{Break (minutes)} $
Formula (extracted text)
$ \text{Total (Decimal)} = \frac{\text{Net Minutes}}{60} $ $ \text{Total (HH)} = \lfloor \frac{\text{Net Minutes}}{60} \rfloor $ $ \text{Total (MM)} = \text{Net Minutes} \mod 60 $
Variables and units
  • No variables provided in audit spec.
Sources (authoritative):
Changelog
Version: 0.1.0-draft
Last code update: 2026-01-19
0.1.0-draft · 2026-01-19
  • Initial audit spec draft generated from HTML extraction (review required).
  • Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
  • Confirm sources are authoritative and relevant to the calculator methodology.
Verified by Ugo Candido on 2026-01-19
Profile · LinkedIn
Formulas

(Formulas preserved from original page content, if present.)

Version 0.1.0-draft
Citations

Add authoritative sources relevant to this calculator (standards bodies, manuals, official docs).

Changelog
  • 0.1.0-draft — 2026-01-19: Initial draft (review required).