Time & date

Hours calculator

Compute the duration between two times, with break and pay options.

01Inputs
/ h
02Results
Net duration
Raw duration
After break
Break deducted
Estimated pay

Net duration = end − start − break. For night shifts, toggle “crosses midnight” to add 24 h to the end time.

03How it works

Why this calculation

Adding and subtracting clock times is an everyday task that a calculator handles badly. People want to know "how many hours did I work today?", "how long is the night shift?", "what does that pause for lunch leave me with?", or "how much do I bill for the meeting that ran from 14:30 to 17:15?" Doing it on paper means converting hours-and-minutes into decimal hours, subtracting, then converting back — error-prone, especially across midnight or with irregular breaks. This calculator does the conversion in both directions, deducts an arbitrary break, optionally multiplies the net duration by an hourly rate, and shows the answer in the two formats people actually use: HH:MM (for timesheets) and decimal hours (for invoices and payroll).

The formula

Net duration = (end − start) − break, where times are first converted to minutes-since-midnight. The headline trap is the night shift: if end is before start (e.g. start 22:00, end 06:00), naive subtraction produces a negative. The fix is a "crosses midnight" toggle that adds 24 × 60 = 1 440 minutes to the result when the end-of-shift is the next calendar day. Decimal hours = net minutes ÷ 60. Pay = decimal hours × hourly rate. The result block shows raw duration (no break), net duration (after break), the explicit break amount for sanity-check, and the calculated pay if a non-zero rate was provided.

How to use

Enter the start time and end time in 24-hour format (the HTML5 time picker will handle locale display). If the shift crosses midnight, flip "Crosses midnight" to Yes — otherwise the calc treats end ≤ start as a zero-duration shift. Enter the break in minutes (0 if none). Optionally enter an hourly rate to get a pay estimate at the bottom — leave it at 0 to skip. The calc updates live as you type. The HH:MM result is for timesheet entries; the decimal-hours result is what payroll software and invoicing tools usually want.

Worked example

Start 09:00, end 17:30, break 60 min, rate 25 €/h. - Raw: 17:30 − 09:00 = 8 h 30 = 510 min = 8.50 h. - Net: 510 − 60 = 450 min = 7 h 30 = 7.50 h. - Pay: 7.50 × 25 = 187.50 €.

Night shift example: start 22:00, end 06:00, "crosses midnight" yes, break 30, rate 0. - Raw with the +1 440 fix: (360 − 1 320) + 1 440 = 480 min = 8 h. - Net: 480 − 30 = 7 h 30.

Pitfalls

Forgetting the midnight flag. Without it, a 22:00–06:00 shift returns "0" because end is before start. The flag is a deliberate explicit choice — auto-detecting "crosses midnight" leads to surprises (an 06:00–05:30 shift is almost certainly a typo, not a 23.5-hour shift, so we refuse to guess).

Negative duration after break. If the break is longer than the shift, net duration is clamped at 0. We do not return a negative — there is no "negative work" semantic.

HH:MM vs decimal hours confusion. 7.5 hours and 7:30 are the same; 7.5 hours and 7:50 are different (the latter is 7 h 50 min = 7.833 h). Always check whether your timesheet expects decimal or sexagesimal — payroll bugs commonly trace back to this confusion.

Rounding for billing. Some agencies bill to the nearest 15 min, some to the nearest 6 min (a tenth of an hour), some to the exact minute. The calc reports to the minute; round to your contract's granularity at the bill-entry step, not in the calc.

Locale time format. The HTML5 time input shows 24-hour or AM/PM depending on the user's locale, but the underlying value is always 24-hour. Submitting the form value to another system, no surprise.

Variations

  • Across multiple days: out of scope — use a date-difference calculator with optional time-of-day for that. This calc treats one continuous shift.
  • Multiple breaks: aggregate them into a single "total break" minutes value before entering. Adding a multi-break UI here would dilute the focus.
  • Overtime calculation: not exposed; OT rules are jurisdiction- and contract-specific (1.5 × after 40 h/week, 1.5 × after 8 h/day in some states, 1.25 × in others). Keep gross hours here, apply OT rules in your payroll workflow.
  • Time-zone aware: this calc is tz-agnostic — both times are in the same zone. Cross-zone duration is the time-zone-converter's job.
  • Sleep duration: technically a special case (start = bedtime, end = wake-time, often crosses midnight). Use the dedicated sleep-cycles calculator if you want bedtime / cycle planning rather than just the duration.
  • Pay annualization: take the decimal hours, multiply by your weekly hours and 52 — that's a rough annual gross. Useful for rate-comparison between freelance and salaried offers, but ignores benefits, paid leave, sick days, retirement matching, and the social contributions employers pay on top of gross. For a true comparison, expect a salaried offer of X € to roughly equal a freelance day-rate of X / 200 working days × 1.7–2.2 (the multiplier covers benefits, taxes, and unpaid time off).
  • Time card rounding (US "7-minute rule"): some US employers round time card entries to the nearest quarter-hour, with values 1–7 min rounding down and 8–14 min rounding up. Apply this rounding after the calc, not inside it — local labor law sometimes prohibits the practice altogether.

Related calculators