Skip to main content
numora.
numora.

Time Duration Calculator: Measure Any Time Span

Hours and minutes between two times

Date-timeByΒ Numora Date & Time TeamNot yet reviewed

Try the calculator

Math runs in your browser. No sign-up.

Assumptions
Total minutes
510

From 9:15 to 17:45 is 8.5 hours.

Decimal hours8.5
Hours8
Minutes30
Embed this calculator on your own site β€” drop in a one-line iframe.
Quick takeaway

Finding the gap between two clock times is one of those calculations that is easy in principle and error-prone in practice, because clock arithmetic is base-60 and wraps at midnight. This calculator converts both times to minutes past midnight, subtracts, and adds a full day when the result is negative β€” which is what makes overnight shifts work correctly. It returns the duration in minutes, in decimal hours, and in hours and minutes. Decimal hours is the figure payroll and invoicing systems expect: 8 hours 30 minutes is 8.5 hours, not 8.30, and that distinction is the single most common source of error in manual timesheets.

What is a time duration?

Calculate the elapsed time between two clock times, including shifts that run past midnight. Enter start and end on a 24-hour clock to get the duration in minutes, decimal hours, and hours and minutes. Decimal hours is the figure payroll and invoicing systems expect β€” 8 hours 30 minutes is 8.5, not 8.30 β€” and confusing the two is the most common error in manual timesheets.

The formula

minutes = (end hour Γ— 60 + end min) βˆ’ (start hour Γ— 60 + start min), + 1440 if negative

Source: Minutes-past-midnight differencing with day wrap.

Worked examples

1A standard office day

Inputs
startHour: 9startMinute: 15endHour: 17endMinute: 45
Walkthrough

09:15 is 555 minutes past midnight and 17:45 is 1,065, a difference of 510 minutes. That is 8.5 decimal hours, or 8 hours 30 minutes. If an unpaid 30-minute lunch was taken, the payable figure is 8.0 hours β€” the calculator gives the span, and the break comes off separately.

2A night shift crossing midnight

Inputs
startHour: 22startMinute: 30endHour: 6endMinute: 15
Walkthrough

22:30 is 1,350 minutes and 06:15 is 375, giving βˆ’975. Adding a full day of 1,440 minutes yields 465 minutes: 7 hours 45 minutes, or 7.75 decimal hours. Handling this by hand is where overnight timesheets usually go wrong, often recorded as 16 hours by subtracting in the wrong direction.

How to use this calculator

  1. Start hour β€” 24-hour clock: 0–23. 9am is 9, 9pm is 21.
  2. Start minute (default: 15)
  3. End hour (default: 17)
  4. End minute (default: 45)
  5. Read the result. Use the worked examples below to sanity-check against a known scenario.

Common mistakes and edge cases

Writing 8 hours 30 minutes as 8.30

This is the dominant timesheet error. Thirty minutes is half an hour, so the decimal form is 8.5. Minutes convert by dividing by 60, not by moving a decimal point: 15 minutes is 0.25, 20 minutes is 0.33, 45 minutes is 0.75.

Mixing 12-hour and 24-hour notation

Entering 5 for a 5pm finish gives a negative span that the calculator then treats as an overnight shift, producing roughly 20 hours. Use 17 for 5pm.

Forgetting unpaid breaks

The gap between clock-in and clock-out includes any break taken. Subtract unpaid break time separately β€” a 30-minute lunch turns an 8.5-hour span into 8 paid hours.

Assuming every day is 24 hours

On daylight-saving transition days a local day is 23 or 25 hours long. A shift spanning the change will be off by an hour under pure clock arithmetic, which is why payroll systems work in UTC.

Frequently asked questions

how do I calculate hours between two times
Convert both to minutes past midnight, subtract, then divide by 60. From 09:15 (555) to 17:45 (1,065) is 510 minutes, which is 8.5 hours.
how do I work out an overnight shift
Add a full day of 1,440 minutes when the end time is earlier than the start. From 22:30 to 06:15 gives βˆ’975, which becomes 465 minutes, or 7 hours 45 minutes. The calculator does this automatically.
how do I convert minutes to decimal hours
Divide by 60. Fifteen minutes is 0.25, 20 minutes is 0.33, 30 is 0.5 and 45 is 0.75. Never write 30 minutes as .30.
does this subtract my lunch break
No β€” it returns the full span between the two times. Subtract unpaid break time separately; a 30-minute lunch turns 8.5 hours into 8 paid hours.
why does my answer look about 12 hours wrong
Almost always 12-hour notation entered without converting. Use 17 for 5pm rather than 5, otherwise the calculator reads it as an overnight span.

Time Duration glossary

Decimal hours
Duration expressed as hours plus a fractional part, where 30 minutes is 0.5. The format payroll systems require.
Minutes past midnight
A time flattened to a single integer by multiplying hours by 60 and adding minutes. Makes subtraction straightforward.
24-hour clock
Notation running 00:00 to 23:59, removing the am/pm ambiguity that causes most duration errors.
Midnight wrap
The correction of adding one day when an end time falls earlier than its start time, indicating the period crossed midnight.

How we built this calculator

Methodology

Clock time is awkward to subtract directly because it carries in base 60 for minutes and base 24 for hours. The reliable method is to flatten both times into a single unit. Multiplying hours by 60 and adding minutes gives minutes past midnight: 09:15 becomes 555 and 17:45 becomes 1,065. The difference, 510 minutes, needs no borrowing.

Formula source
Minutes-past-midnight differencing with day wrap
Last updated
2026-11-17
Calculation runs
Client-side only
ND
WRITTEN BY
Numora Date & Time Team

Sources & references

Every numeric assumption traces to a primary source.

  1. U.S. Department of Labor β€” Fair Labor Standards Act Hours Worked AdvisorUSA
  2. NIST β€” Time and Frequency Division, Time RealizationUSA
  3. ISO 8601 β€” Date and time representationsINT
  4. Numora Editorial Policy. numora.net/editorial-policy