Article — Hours Calculator
Hours calculator: between times, add/subtract, decimal conversion
An hours calculator handles three common time math problems: finding the duration between two clock times, adding or subtracting hour-and-minute durations, and converting between HH:MM format and decimal hours. The calculator above does all three. 9 AM to 5 PM with a 30-minute break equals 7.5 paid hours; 2h 45m plus 1h 30m equals 4h 15m; and 7h 15m equals 7.25 decimal hours.
Each mode targets a different workflow. Payroll uses decimal hours. Shift workers care about start-to-end clock math, including overnight rollovers. Project managers add and subtract billable durations. The mathematics is straightforward, the formatting is where most errors creep in.
What is an hours calculator?
An hours calculator is a tool for arithmetic on durations and clock times. The challenge is that time is base 60 for minutes and seconds, base 12 or 24 for hours, and base 7 for days. Most arithmetic in everyday life uses base 10, so manual time math demands constant base-conversion: 75 minutes is 1 hour 15 minutes, 90 minutes is 1.5 hours.
The calculator above shifts that mental burden onto code. Type the inputs in whichever format you have them (clock times, HH:MM durations, decimal hours), pick the operation, and read the result in the format you need.
Hours between two times
The most common hours calculation: how long is the span between a start time and an end time? The math is straightforward when both times are on the same day. Subtract the start from the end in minutes, divide by 60.
minutes = (h2 × 60 + m2) - (h1 × 60 + m1) hours = minutes / 60Worked example. 9:00 to 17:30. End is 17 × 60 + 30 = 1050 minutes from midnight. Start is 9 × 60 = 540 minutes. Difference is 510 minutes, or 8.5 hours. Subtract a 30-minute lunch and the net work duration is 8 hours flat.
Adding and subtracting hours
Adding HH:MM durations is one of the few times base-60 math actually matters. 45 + 30 = 75 minutes, but the convention is 1h 15m. The "carry" digit moves to the hours column whenever minutes total 60 or more.
The 60-minute hour traces back to ancient Babylonian astronomy. Babylonian mathematicians used base 60 because it has many divisors (1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60), making fractional calculations easy with only addition and subtraction. Their system survived the Greeks, the Romans, and every subsequent calendar reform. Every modern computer's clock chip still does base-60 arithmetic at the minute boundary.
Subtraction has the mirror-image rule: when the smaller-minutes value sits below the larger, you borrow from the hours column. 3h 15m minus 1h 45m. The minutes 15 minus 45 is negative, so borrow one hour (60 minutes): now 75 minus 45 = 30. The hours 3 minus 1 minus 1 (borrowed) = 1. Result: 1h 30m. The calculator does all of this in one step.
Hours to decimal conversion
Decimal hours are easier to multiply and add in spreadsheets and payroll systems. The conversion is straightforward: divide minutes by 60 and add to the hours integer. Common fractions:
- 0h 15m = 0.25 h (quarter hour)
- 0h 20m = 0.333 h (one-third)
- 0h 30m = 0.50 h (half hour)
- 0h 45m = 0.75 h (three quarters)
- 1h 06m = 1.10 h (rounded to tenth)
- 7h 30m = 7.50 h (standard shift)
- 8h 00m = 8.00 h (full shift)
- 40h 00m = 40.00 h (US workweek)
The reverse direction takes a decimal hour value and produces HH:MM. The integer part is the hour count. The fractional part times 60 gives minutes. 7.75 hours equals 7 hours + 0.75 × 60 = 7h 45m. Watch the rounding: 7.7333... hours is 7h 44m, not 7h 43m or 7h 45m. The calculator above rounds to the nearest minute.
Payroll hours calculation
US payroll runs in decimal hours. A timecard logging 7:45, 8:00, 7:30 across three days totals 23 hours 15 minutes in HH:MM, or 23.25 hours in decimal. The decimal form multiplies cleanly with hourly rate: 23.25 hours × $25/hr = $581.25.
If your employer rounds time entries, check whether the rounding is neutral. The FLSA permits rounding to the nearest 6 minutes (0.1 hour) or 15 minutes (0.25 hour) so long as the rounding doesn't systematically shave employee hours. A 7:43 clock-out rounded to 7:45 is fine; one that always rounds down to 7:30 is wage theft.
Some industries use tenths of an hour (6-minute increments). Legal billing, IT contracting, and consulting are common examples. 6 minutes is exactly 0.1 hour, which makes the rounding intuitive: 0.0, 0.1, 0.2,... 0.9, 1.0. A task that took 14 minutes rounds to 0.2 hours (12 min) or 0.3 hours (18 min) depending on the firm's policy.
Hours and overtime rules
US federal law (FLSA) sets overtime at any hours worked beyond 40 in a workweek. The overtime rate is 1.5 times the regular rate. California and a few other states have daily overtime: any hours over 8 in a single day trigger 1.5x; over 12 in a single day trigger 2x.
European Union states use the Working Time Directive: 48 hours per week maximum (averaged over 17 weeks), with most member states defaulting to a 40-hour standard week and paying overtime above that. France's famous 35-hour week is a labor-contract default, not an absolute cap.
Crossing midnight: overnight hours
An overnight shift is the classic edge case in hours math. A worker clocks in at 22:00 and out at 06:00 the next morning. Naive subtraction gives 06:00 minus 22:00 = -16:00, which is obviously wrong.
The fix: when the end time is numerically smaller than the start time, add 24 hours to the end. 06:00 plus 24:00 = 30:00, minus 22:00 = 8:00. The shift was 8 hours. The calculator above detects this case automatically and flags "crosses midnight" in the breakdown.
Watch out for shifts that span exactly 24 hours or more. Most shift schedules have legal caps (US trucking: 11 driving hours per day, EU: 9 base hours with extensions). If you see "23h 59m" as a duration, double-check that both times are entered correctly.
Common hours calculation mistakes
Mixing decimal and HH:MM mid-calculation. 2.5 + 1h 45m is not 2.95 — it's 4h 15m. Convert everything to one format before adding.
Subtracting break time from clock duration in the wrong direction. Net work hours = gross duration minus break. A 9-to-5 day with a 30-minute lunch is 7.5 paid hours, not 8.5.
Excel and Google Sheets treat time as fractions of a day under the hood. Adding two cells that display "01:30" each gives "03:00" only if you format the result cell as time. If you format it as a number, you get 0.125 (which is three hours expressed as a fraction of a 24-hour day). Verify formatting before trusting payroll totals.