Skip to content
Time Duration Calculator

Time Duration Calculator

Enter a start and an end time in the time duration calculator and you get the span in hours and minutes and in decimal hours: 9:15 AM to 5:00 PM is 7 h 45 min, or 7.75. Night shifts, breaks, dates and clock changes are handled too.

  1. Enter a start and an end time.
  2. The result updates as you type.
  3. Copy the hours or the decimal hours.

Enter a start and an end time to see hours and minutes, decimal hours, total minutes and seconds.

Type 7.65 to get 7 h 39 min, or 7:39 to get 7.65.

How many hours are between two times?

Subtract the start from the end, hours from hours and minutes from minutes. A 9-to-5 day is 17:00 − 9:00 = 8 hours. From 8 AM to 5 PM is 17:00 − 8:00 = 9 hours.

From 9:15 AM to 5:00 PM you cannot take 15 from 0, so borrow one hour: 17:00 becomes 16:60, and 16:60 − 9:15 = 7:45. That is 7 h 45 min, or 465 minutes, or 27,900 seconds. On a timesheet it is written as 7.75 decimal hours, because 45 minutes is three quarters of an hour.

The time duration calculator does this on the Between times tab. Pick 12-hour or 24-hour (the choice is remembered), fill in Start time and End time (the Now button drops in the current clock time) and press Calculate duration. The result shows h:mm with Decimal hours, Minutes and Seconds next to it, each with a Copy button. Tick Show seconds for short spans. Copy result copies the whole answer as one line, and Share link copies a link that holds only your inputs.

Shifts that cross midnight

A night shift from 22:00 to 06:00 gives −16 hours if you subtract naively. The end is on the next day, so add 24 hours to it first: 30:00 − 22:00 = 8 hours. Or count it as 2 hours before midnight plus 6 after.

Timeline of a 22:00 to 06:00 shift split at midnight into 2 hours and 6 hours
A shift that crosses midnight: add 24 h to the end time, or count the hours on each side of 00:00.

Borrowing works the same way overnight. From 4:07 PM to 8:13 AM: write 8:13 AM as 32:13, then 32:13 − 16:07 = 16:06, so 16 h 6 min, or 16.10 hours.

Watch the two twelves. 12 AM is midnight (00:00) and 12 PM is noon, so 12:30 AM to 12:30 PM is 12 hours, not zero. When the end time is earlier than the start, the calculator assumes the next day and marks the result with the badges +1 day and Crosses midnight. If both times are equal, it returns 0 h 0 min instead of quietly guessing 24 hours; for a full day, use the Dates & times tab.

Hours and minutes vs decimal hours

Payroll and invoices multiply hours by a rate, and you cannot multiply 7:45 by a pay rate. Divide the minutes by 60: 45 ÷ 60 = 0.75, so 7 h 45 min = 7.75 h. The slip I see most is reading clock digits as decimals. 7:30 is 7.50 hours, not 7.30, and 7.30 hours is really 7 h 18 min. The Decimal ↔ h:mm box under the result converts both ways: type 7.65 and you get 7 h 39 min.

Minutes as decimal hours (rounded to 2 places)
MinutesDecimal hours
5 min0.08
6 min0.10
10 min0.17
12 min0.20
15 min0.25
20 min0.33
25 min0.42
30 min0.50
40 min0.67
45 min0.75
50 min0.83
55 min0.92

The full 1–60 minute chart, plus tenth-of-an-hour units, is in minutes to decimal hours.

Adding and subtracting time

Add the duration and take away 24 hours whenever you pass midnight. 21:45 + 3 h 30 min = 25:15, which is 01:15 the next day. Going back works the same way: 00:20 − 45 min = −0:25, so add 24 hours and get 23:35 the day before.

On the Add or subtract tab enter a Start time, choose Add or Subtract, and fill any of Days, Hours, Minutes and Seconds. Hours may go past 23. Add a Start date and the answer shows the full weekday and date; without a date you get the clock time plus a day offset such as +1 day or −1 day.

Breaks, timesheets and rounding

An unpaid break comes off after you measure the span. Clock in at 7:58 AM and out at 4:07 PM: 16:07 − 7:58 = 8 h 9 min; minus a 30-minute lunch gives 7 h 39 min. In decimals that is 39 ÷ 60 = 0.65, so 7.65 hours. Enter the break in Break (minutes) on Between times; if it is longer than the span, you get an error instead of a negative shift.

For a week, the Timesheet tab takes one row per shift: Clock in, Clock out, Break (min). Add row adds another, up to 14, and the rows stay in this browser for next time. The example week has four 8:00 AM–4:30 PM days with 30 minutes off (8 h each) and one 10:00 PM–6:15 AM night with 45 minutes off (7 h 30 min): 39 h 30 min, or 39.50 hours. My rule here: add up the minutes first and convert once at the end. Rounding each row to two decimals and adding them can drift by a hundredth or two per week.

The Rounding menu applies Nearest 5 min, Nearest 6 min (0.1 h) or Nearest 15 min to every punch and shows the Rounded and Actual totals side by side, with the Difference in minutes. With quarter-hour rounding, the 7:58–4:07 day becomes 8:00–4:00 minus 30 = 7.50 hours, nine minutes less than actually worked. Why that must even out over time is in time clock rounding. Copy table and Download CSV send the week to a spreadsheet.

Daylight saving time and long spans

A wall clock is not a stopwatch. In the United States, clocks go back from 2:00 to 1:00 a.m. on the first Sunday of November, so a 22:00–06:00 shift that night lasts 9 real hours. On the second Sunday of March they jump from 2:00 to 3:00, so midnight to 6:00 that morning is only 5 hours. In the UK and the EU the change falls on the last Sunday of March and of October.

Three bars for the same 22:00 to 06:00 shift: 8 hours on a normal night, 9 when clocks go back, 7 when clocks go forward
The same wall-clock shift on three nights: the clock change adds or removes a real hour.

On the Dates & times tab your own Time zone is already selected, so the time duration calculator counts real elapsed time with your browser's time zone rules. When a change falls inside the span, a Clock change badge appears with the note "Includes a clock change: +1 h (clocks went back)", and the plain figure is listed as Without the clock change. Choose None (ignore clock changes) for plain calendar arithmetic. From 13 July 18:00 to 20 February 11:00 the following year is 221 days 17 hours, or 5,321 hours, by plain arithmetic; in New York time it is 5,322 hours, because the November change adds an hour.

Time differences in a spreadsheet

Spreadsheets store time as a fraction of a day, so =B2−A2 goes negative over midnight. The fix: =MOD(B2−A2,1)*24 gives decimal hours for any shift under 24 hours, 22:00 to 06:00 included. Breaks, [h]:mm totals and a full weekly layout are in time difference in Excel and Google Sheets.

The clock arithmetic behind the time duration calculator

Everything runs in your browser; nothing you type is sent anywhere. A shared link carries the inputs after the # in the address. The rules:

  • Between times: duration = (end − start) mod 24 h. If the end is earlier than the start, it belongs to the next day. 12 AM = 00:00, 12 PM = 12:00, other PM hours + 12.
  • Decimal hours = seconds ÷ 3,600, shown to 2 decimal places and rounded half up on the exact value, so 3 h 59 min = 3.98. Totals are summed in seconds (whole minutes on the Timesheet) and converted once.
  • Clock changes come from the time zone database built into your browser. The US rule (second Sunday in March, first Sunday in November, both at 2:00 a.m.) is published by NIST. A time skipped by the spring change is flagged; a repeated time uses the first occurrence.
  • Rounding uses the three increments named in 29 CFR 785.48(b): 5 minutes, a tenth of an hour, a quarter of an hour. Each punch is rounded to the nearest step: with quarter hours 8:07 → 8:00 and 8:08 → 8:15. Only the 6-minute step can land exactly halfway, and then it goes up, so 8:03 → 8:06. Breaks are not rounded.

Cases worked by hand on this page, each one reproduced by the tool's tests:

Control cases
InputExpected result
9:15 AM → 5:00 PM7 h 45 min · 7.75 · 465 min · 27,900 s
22:00 → 06:008 h 0 min · 8.00 · +1 day · Crosses midnight
4:07 PM → 8:13 AM16 h 6 min · 16.10 · +1 day
23:59:30 → 00:00:15, Show seconds0 h 0 min 45 s · 0.01
7:58 AM → 4:07 PM, break 30 min7 h 39 min · 7.65 · span 8 h 9 min
13 July 18:00 → 20 February 11:00, None (ignore clock changes)221 days 17 h 0 min · 5,321 hours
The same span, America/New_York221 days 18 h 0 min · 5,322 hours · +1 h (clocks went back)
New York, 22:00 → 06:00 on the night the clocks go back9 h 0 min
New York, 00:00 → 06:00 on the morning the clocks go forward5 h 0 min · −1 h (clocks went forward)
21:45 + 3 h 30 min01:15 · +1 day
Timesheet example week39 h 30 min · 39.50
Timesheet 7:58 AM–4:07 PM, break 30Actual 7.65 · Nearest 15 min 7.50 · Nearest 6 min 7.60 · Nearest 5 min 7 h 35 min
Decimal ↔ h:mm: 7.65 and 3:597 h 39 min · 3.98

Limits: the Timesheet works in whole minutes and ignores seconds, and a time zone can only be as accurate as the time zone data in your browser. The rounding feature shows the arithmetic; it does not tell you whether a pay policy is lawful where you work.

Questions and answers

How many hours is 9 to 5?

8 hours: 17:00 − 9:00 = 8:00. With an unpaid 30-minute lunch, it is 7.5 hours of paid time.

How do I calculate hours past midnight?

Add 24 hours to the end time before you subtract. 22:00 to 06:00 is 30:00 − 22:00 = 8 hours; the calculator does this automatically and marks the result +1 day.

What is 7 hours 45 minutes in decimal?

7.75 hours, because 45 ÷ 60 = 0.75. To convert any time, divide the minutes by 60 and add them to the whole hours.

Is 7:30 the same as 7.3 hours?

No. 7:30 is 7.5 hours; 7.3 hours is 7 hours 18 minutes. Clock minutes run to 60, decimals run to 100.

Does daylight saving change my shift?

Yes, when the shift spans the change. A 22:00–06:00 night is 9 real hours when clocks go back and 7 when they go forward; choose a time zone on the Dates & times tab to see it.

Can my employer round my time?

US federal rules accept rounding punches to the nearest 5, 6 or 15 minutes only if it evens out over time and does not underpay workers. State law can be stricter, so check with your state labor department.

Guides

About this site