Clock and duration arithmeticReviewed 29 Sep 2026Runs in your browser

Time Calculator: Duration, Add & Subtract

Find the time between two clock times, add or subtract hours and minutes from a time, or add up a list of durations. Overnight spans, unpaid breaks and decimal hours for payroll are handled.

Who wrote it

Written by Suhaib Hassan. Figures are estimates you can edit. Our methodology.

How the engine works

It converts clock times to minutes since midnight, does the arithmetic on whole minutes, and turns the answer back into hours, minutes and decimal hours.

Why we built it

Clock arithmetic goes wrong around midnight and with breaks. This handles both and gives the decimal hours a timesheet needs.

Time calculation

for overnight spans
minutes
$
Net duration—
—

—

Decimal hours—
Total minutes—
Total seconds—
Pay—
Working

—

Minutes to decimal hours

Payroll usually needs time as hours in decimals. Divide the minutes by 60.

MinutesDecimalMinutesDecimal
5 min0.08 h35 min0.58 h
10 min0.17 h40 min0.67 h
15 min0.25 h45 min0.75 h
20 min0.33 h50 min0.83 h
25 min0.42 h55 min0.92 h

The 7-minute rounding rule. Where an employer rounds to the nearest quarter hour, 1 to 7 minutes round down and 8 to 14 minutes round up to the next quarter. So 8 to 22 minutes count as 15 minutes, 23 to 37 as 30, 38 to 52 as 45 and 53 to 60 as a full hour. Rounding must average out so employees are paid for all time worked.

Formulas

How the numbers are worked out.

Time between two clocks

Convert both times to minutes since midnight, add a day offset if the end is on a later day, and subtract.

elapsed = (end + 1440 × days) − start
net = elapsed − break

Add or subtract time

Add or subtract the span in minutes, then wrap around 24 hours to get the clock time and the day shift.

result = start ± (days × 1440 + hours × 60 + minutes)

Decimal hours

Minutes divided by 60. Pay is decimal hours times the hourly rate.

decimal hours = minutes ÷ 60
pay = decimal hours × rate

Worked examples

Illustrative figures, each checked by hand. The first is the default setup.

Shift with a break

8:45 AM to 5:15 PM, 45 minute unpaid break, $30 an hour (the default).

elapsed = 17:15 − 08:45 = 8 h 30 m
net = 8 h 30 m − 45 m = 7 h 45 m = 7.75 h
pay = 7.75 × $30 = $232.50

Night shift

10:00 PM to 6:30 AM the next day, 30 minute break.

(6:30 + 24 h) − 22:00 = 8 h 30 m
net = 8 h 00 m = 8.00 h

Add time

9:00 AM plus 2 hours 45 minutes.

9:00 + 2:45 = 11:45 AM the same day

How to calculate time

  • Choose whether to find the time between clocks, add or subtract, or add up durations.
  • Enter the times. For a shift that ends after midnight, set the end to the next day.
  • Add the unpaid break and an hourly rate if you want pay.
  • Read the duration in hours and minutes, decimal hours and total minutes.

For a full weekly timecard with overtime, use the Hours Calculator. Check local rules on rounding and breaks before relying on the payroll figures.

By Suhaib Hassan · Reviewed 29 September 2026 · How CalculatePilot verifies formulas →

Sources

  • U.S. Department of Labor, 29 CFR 785.48(b), rounding of working time.
  • NIST, Time and Frequency Division, definition of the second and the day.
  • ISO 8601, Date and time format.

Frequently asked questions

How do I calculate time between two times?

Convert each to minutes since midnight and subtract. If the end is earlier than the start the span crosses midnight, so add 24 hours to the end.

How do I convert minutes to decimal hours?

Divide the minutes by 60. 45 minutes is 0.75 hours, and 7 hours 45 minutes is 7.75 hours.

What is the 7-minute rule?

A payroll method that rounds working time to the nearest quarter hour. Up to 7 minutes rounds down, 8 minutes or more rounds up.

How do I subtract time?

Choose Subtract, enter the hours and minutes to take away, and the result shows the earlier clock time and how many days back it falls.

Does it handle daylight saving?

No. It does clock arithmetic on a 24-hour day, so a shift across a daylight saving change will be an hour out.

Related calculators

More everyday tools.

All Everyday Calculators

Embed This Time Calculator

Free and responsive, and it runs in the visitor's browser. Branding removal from $7.99/month.

<iframe src="https://www.calculatepilot.com/embed/time-calculator.html" width="100%" height="560" loading="lazy" title="Time Calculator"></iframe>
For website owners

Want this calculator on your own website?

Embed it in one line of code. Keep it free with a small CalculatePilot attribution link, or go white-label: your brand, no attribution, one license for all your domains.

  • All 159 calculators, unlimited embeds
  • Works on WordPress, Webflow, Squarespace, Wix and plain HTML
  • Runs in your visitor's browser, so nothing is sent to a server
  • License key emailed automatically after checkout, cancel anytime
$7.99 / month
or $89.99 / year · white-label Pro
Get the white-label license Embed free with attribution