How to Calculate Hours Between Two Times (Time Card Math, Explained)

Time-card math trips up smart people every payday. Here is the clean way to do it — including the overnight-shift edge case that breaks most spreadsheets.

Every hourly worker, shift manager and freelancer has done this math wrong at least once. Calculating hours between two times looks trivial — subtract start from end — until you cross midnight, or take an unpaid break, or need to bill in decimal hours instead of hours-and-minutes. This guide covers all three.

The basic formula

Hours worked = End time − Start time − Unpaid breaks

Worked example

Start 9:15 AM, end 5:45 PM, 30-minute unpaid lunch.

5:45 PM − 9:15 AM = 8h 30m. Minus 30 min break = 8 hours 0 minutes.

The overnight-shift trap

Start 10:00 PM, end 6:00 AM. Naive subtraction gives 6 − 22 = −16 hours. Wrong.

Fix: if End < Start, add 24 hours to End before subtracting.

(6 + 24) − 22 = 8 hours. Correct.

Every spreadsheet formula that silently returns a negative or `#####` value on overnight shifts is failing this check.

Converting to decimal hours (for payroll)

Payroll systems want hours as a decimal, not `8h 15m`.

Decimal hours = whole hours + (minutes ÷ 60)

  • 15 min = 0.25
  • 20 min = 0.33
  • 30 min = 0.50
  • 45 min = 0.75

So 8h 15m = 8.25 hours. Multiply by hourly rate for pay.

Rounding rules that keep employers honest

US federal law (FLSA) allows time-card rounding to the nearest 5, 6 or 15 minutes — but the rounding must be neutral over time (favouring neither employer nor employee). The safest rule for workers: track actual minutes, then compare against the rounded total each pay period.

Common rounding conventions:

  • Nearest 15 min — 7:07 rounds to 7:15, 7:08 rounds to 7:15
  • Nearest 6 min (tenths of an hour) — used by most legal-billing software
  • Nearest 1 min — the truest, and increasingly the default in modern time-tracking apps

Overtime math

In the US, non-exempt workers get 1.5× pay for hours over 40 in a workweek (some states also require daily overtime above 8 hours).

Weekly pay = (Regular hours × rate) + (Overtime hours × rate × 1.5)

Example: 45 hours worked, $20/hr rate = (40 × 20) + (5 × 20 × 1.5) = 800 + 150 = $950.

Freelancer billing: fractional hours

Most agencies bill in 15-minute or 6-minute increments. To convert a stopwatch time of 1h 23m to billable time:

  • Round up to nearest 15 min → 1h 30m → 1.50 hours
  • Round up to nearest 6 min → 1h 24m → 1.40 hours

Round *up* for billable time; round *nearest* for time-cards. Different intent, different rule.

Frequently asked questions

How do I calculate hours across a Daylight Saving change? The clock shifts by ±1 hour; the *actual* hours worked do not. Manually add or subtract 1 hour to the raw difference on those two days a year.

Should breaks always be unpaid? In the US, meal breaks 30 min or longer are typically unpaid; short rest breaks under 20 min must be paid. State law overrides — California, for example, has stricter meal-period rules.

How do I calculate hours worked in Excel? Use `=TEXT(End − Start, "h:mm")` for display, or `=(End − Start) * 24` for decimal hours. Wrap the difference in `MOD(End − Start, 1)` to handle overnight shifts.

What is a 40-hour work week in decimal? Exactly 40.00 — no conversion needed. A 37.5-hour week (common in Europe) is 37.50.

Do lunch breaks count toward overtime? Only if they are paid. Unpaid meal breaks do not count toward the 40-hour overtime threshold.

Use our free calculators for related time math — the Age Calculator for exact durations in years, months and days, and the Percentage Calculator for tax and take-home checks on your paycheck.

Related