Hours Calculator

Work out the hours between two times, with the break taken off — then turn the same entry into a weekly timecard, duration arithmetic, hours from now, or decimal hours, without leaving the page.

Hours between two times

Type 9:00 AM, 09:00 or 0900 — all three are read the same way.
An end earlier than the start is read as the next day, and the result says so.
Deducted from the gross interval. A break longer than the shift is rejected, not clipped.
The only way to turn an equal start and end into 24 hours. It is never assumed for you.
Enter break times instead
+ Add dates

Only needed when the interval spans more than one day, or when a daylight-saving change falls inside it. With dates, elapsed time is measured between real instants and the calendar figure is reported separately whenever the two differ.

Display and rounding

The clock format matches this device already, and nothing is rounded unless you ask for it.

Display and rounding
A display choice only. No calculation on this page reads an AM/PM string.
Exact is the default. Rounding each clock entry and rounding the final duration are different operations and can give different answers.
Net worked time8 hr 00 min8.00 decimal hours · 480 minutes

Verified The hours-and-minutes figure, the decimal figure and the minute total were re-derived from the same integer second count and agree exactly.

Gross duration
8 hr 30 min
Break
30 min
Decimal hours
8.00
Total minutes
480

9:00 AM → 5:30 PM = 8 hr 30 min. Minus 30 min break = 8 hr 00 min (8.00 decimal hours).

Show calculation
Start
09:00
End
17:30
Elapsed
17:30 − 09:00= 8 hr 30 min= 510 minutes
Break
30 minutes (unpaid)
Net
510 − 30= 480 minutes
Decimal hours
480 ÷ 60= 8.0000 hours

Assumptions

  • Start and end are on the same day.
  • The break is unpaid, so it is deducted from the worked time.
  • Exact — no rounding applied.
  • These are undated clock times, so no time-zone or daylight-saving conversion was needed.

Engine: hours-engine v1.0.0

Gross time, break and net time stay three separate numbers here, and an overnight end is announced rather than assumed — because 9:00 to 9:00 is zero hours until you say otherwise.

Common work-hour calculations

Every answer below is produced by the calculator's own engine when this page is built, so none of them can drift away from the tool. Select one to load it into the calculator.

How to calculate hours between two times

Convert both times to the 24-hour clock, subtract, and read the answer as hours and minutes:

duration = end − start

17:30 − 09:00 is 8 hr 30 min. Working in 24-hour form is not a stylistic preference — it removes the two places where hour arithmetic usually goes wrong, which are 12 AM and 12 PM. When the end time is earlier on the clock than the start, the shift crossed midnight, and the formula becomes:

duration = (24 h − start) + end

For 23:00 to 07:00 that is 1 hour to midnight plus 7 hours after it, so 8 hours. This calculator makes that reading visible rather than silent, because an unannounced overnight assumption is indistinguishable from a bug.

How to calculate work hours

Worked time is not the same as the interval between the first clock-in and the last clock-out. Add every work period, then take off the breaks that are unpaid:

worked time = Σ work intervals − unpaid breaks

A day of 08:00–12:00 and 13:00–17:00 is two intervals of four hours, so eight hours of work time. Flattening it into a single 08:00–17:00 entry and then guessing at an hour of break gives the same answer here by luck and a different answer the moment the lunch is 45 minutes. Paid breaks are deducted from nothing: they are inside the paid day, so the calculator totals them separately and leaves worked time alone.

How to convert hours and minutes to decimal hours

Timesheets and payroll systems usually want a decimal, not a clock reading:

decimal hours = hours + minutes ÷ 60 + seconds ÷ 3600

7 hr 45 min is 7 + 45 ÷ 60 = 7.75. The failure this prevents is writing 7 hr 45 min as “7.45”, which is 18 minutes short and looks entirely plausible on a form. Going the other way — hours to minutes — is a multiplication by 60, so 7.75 hours is 465 minutes. The reference table below is generated by that same division.

Generated by the same conversion the calculator uses — minutes ÷ 60.
MinutesDecimal hours
1 min0.0167
5 min0.0833
6 min0.1000
10 min0.1667
15 min0.2500
20 min0.3333
30 min0.5000
45 min0.7500
60 min1.0000

How to add and subtract hours

Add hours to hours and minutes to minutes, then carry each 60 minutes into an hour. 2 hr 45 min + 1 hr 30 min is 3 hr 75 min, which carries to 4 hr 15 min — 4.25 decimal hours, 255 minutes, 15,300 seconds. Subtraction is the same operation with a negative sign, so 8 hr 30 min − 1 hr 45 min = 6 hr 45 min. Internally every row becomes an integer number of seconds before anything is added, which is why a long list of rows cannot accumulate rounding drift.

Overnight shifts

A shift that starts at 10:00 PM and ends at 6:00 AM is eight hours, and the only reason it is awkward is that the clock resets in the middle of it. There are exactly two honest ways to handle it: detect that the end is earlier than the start and say so, or let the user state that the end is on the next day. This calculator does both, and keeps them apart, because of one case that separates a careful tool from a careless one: 09:00 to 09:00. On the same day that is zero hours. With the next-day control set it is 24 hours. A calculator that quietly turns the first into the second has converted a typo into a full day of pay.

12-hour vs 24-hour time

12-hour time needs AM and PM to be unambiguous, and its two edge values are the ones people get wrong: 12:00 AM is midnight (00:00) and 12:00 PM is noon (12:00). 24-hour time — the same clock people call military time when it is written without a colon, as 0900 or 1730 — has no such ambiguity, which is why this engine normalizes to it before any arithmetic runs. The format selector on the calculator changes the display only; you can type 9:00 AM, 09:00 or 0900 interchangeably and all three become the same integer internally.

Decimal hours for timesheets and payroll

Payroll multiplies a rate by a number, so it needs 7.75 rather than 7:45. Two habits make decimal hours safe: convert from the exact minute count rather than from an already-rounded clock reading, and keep enough precision to survive a week of additions. This calculator derives every decimal figure from the same integer second count that produces the hours-and-minutes figure beside it, so the two can never disagree — a mismatch there is one of the most common defects in hour calculators, and it is the kind that survives review because both numbers look right on their own.

Exact time vs rounded payroll time

Exact is the default here. If your workplace rounds, two things matter. First, which operation is being rounded: rounding each clock entry to the nearest quarter hour is a different calculation from rounding the finished duration, and the two produce different totals often enough that stating which one you mean is part of the answer. A punch at 9:07 rounds down to 9:00 at a 15-minute increment, while 9:08 rounds up to 9:15 — and applying that to both ends of a shift is not the same as taking the elapsed time and rounding once. Second, rounding is a policy question, not an arithmetic one: whether it is permitted, and in whose favour, is set by law and contract. The calculator will apply the increment you choose and show it as its own line in the receipt, so a rounded figure is never mistaken for a measured one.

Hours from now and hours ago

“What time will it be in eight hours?” is a question about an instant, not about a clock face. Adding eight hours to a clock reading of 10:44 PM gives 6:44, but only adding to a real instant tells you it is 6:44 AM the next morning — and only that approach survives a daylight-saving change on the night in question. The From Now / Until mode reads your device's clock when the page loads, adds the offset to that instant, and shows the resulting time, weekday and date along with the time zone it used. You can also count from a date and time you choose, or count down to one.

Duration versus calendar time, and daylight saving

Seventy-two elapsed hours and three calendar days are the same thing for most of the year and different twice a year. In a zone that observes daylight saving, a local midnight-to-midnight “day” is 23 hours when the clocks go forward and 25 hours when they go back, even though the calendar shows one day in both cases. Undated clock times carry no time zone at all, so the question never arises for a plain start-and-end calculation. As soon as you add dates, this calculator resolves both ends to real instants, computes elapsed time as a subtraction of instants, and reports the calendar figure separately whenever the two disagree.

A worked reference case, computed by the shipped engine at build time: from 2026-03-08T01:30:00−05:00 to 2026-03-08T03:30:00−04:00 the wall clock advances two hours, but the true elapsed time is 1 hr 00 min, because the offset changed from −05:00 to −04:00 in between. That vector is part of the engine's test suite, not a claim in prose.

Hours in a day, week, month and year

A day is 24 hours and a week is 168. A month has no single number of hours, and any calculator that gives one is rounding a calendar into a rule. February alone can be 672 or 696 hours.

Every figure is computed, not stored. A month has no single answer, so all four lengths are listed.
PeriodHours
A day24 hours
A week168 hours
A 28-day month672 hours
A 29-day month696 hours
A 30-day month720 hours
A 31-day month744 hours
Average Gregorian month730.485 hours (an average, not any real month)
A 365-day year8,760 hours
A 366-day leap year8,784 hours
Average Gregorian year8765.82 hours (365.2425 days)

Verified calculations

Each line is run through the engine this page ships, at build time. If any of them changed, the build's golden gate and the engine test suite would fail before the page could publish.

This page determines worked time. It does not decide what that time is legally worth. Need jurisdiction-specific overtime — daily thresholds, double time, the seventh consecutive day, the regular rate of pay? Use the Overtime Calculator. Converting an annual salary into an hourly figure, or the other way round? That is the Salary to Hourly Calculator. Converting units that are not durations? The Conversion Calculator covers those.

Methodology & verification

Five modes run on one dedicated engine stack (hours-engine v1.0.0). Every undated clock input is normalized before any arithmetic: "5:30 PM" becomes 17:30 becomes 63,000 seconds after midnight, and from that point on nothing reads an AM/PM string — the 12-hour and 24-hour settings are a display choice applied to the finished number. Durations are carried as integer seconds and may be negative, so the Add/Subtract mode needs no separate sign handling and decimal hours are always derived from the exact figure rather than shown beside it. A dated calculation carries a real instant instead of a clock reading, so elapsed time is a subtraction of instants; the wall-clock difference is computed alongside it and both are reported whenever a daylight-saving transition makes them disagree. Gross duration, break time and net duration stay three separate numbers throughout. Overnight ends, rounding and break treatment are explicit operations, each shown as its own line in the calculation receipt, and rounding each clock entry is treated as a different operation from rounding the final duration because the two produce different answers. Logically invalid input — a break longer than the shift, overlapping breaks, a break outside the work period, an end date before the start date, minutes above 59 — produces a named error instead of a clamped, plausible-looking number.

  • Normalization: every undated clock input becomes an integer number of seconds after midnight before any arithmetic runs, so no calculation depends on a formatted AM/PM string and the 12/24-hour setting cannot change a result.
  • Durations: carried as integer seconds and allowed to be negative; decimal hours are always derived from that figure, never shown alongside an independently computed one.
  • Dated calculations: resolved to real instants, so elapsed time is a subtraction of instants. Explicit UTC offsets are exact; a local calculation uses this device's time-zone database. The wall-clock difference is computed alongside and both are reported when they disagree.
  • Overnight: an end earlier than the start is treated as the next day and the assumption is stated on the result. An equal start and end is zero; 24 hours requires the explicit next-day control.
  • Breaks: unpaid break time reduces worked time and paid break time does not. Break intervals are validated against the work period — outside, overlapping, zero-length or over-long breaks are refused with a named error.
  • Rounding: off by default. Rounding each clock entry and rounding the final duration are separate operations, and whichever ran is named in the receipt.
  • Verification: every result re-derives its headline from the components displayed beside it — the hours-and-minutes recomposition, the decimal round trip and the gross-minus-break chain must all reproduce the same integer second count before the “Verified” badge appears.
  • Fail-closed errors: minutes above 59, a break longer than the shift, overlapping breaks, a break outside the work period, an end date before the start date and an out-of-range interval each produce a structured error instead of a clamped number.
  • Privacy: every calculation runs in your browser. A share link carries your inputs in the URL fragment, which browsers never transmit to a server, and it excludes names and notes unless you opt in.

Assumptions

  • An undated clock time is an integer number of seconds after midnight, so 12:00 AM is 00:00 and 12:00 PM is 12:00 with no special-case string handling.
  • An end time earlier than the start time is treated as the following day, and that assumption is always stated on the result rather than applied silently.
  • An equal start and end on the same day is zero hours; twenty-four hours is only ever produced by the explicit next-day control.
  • Unpaid breaks reduce worked time and paid breaks do not; the two are totalled separately.
  • No rounding is applied unless you choose it, and the receipt names which rounding operation ran.
  • Undated clock calculations involve no time zone at all; only a dated calculation resolves instants, and it uses this device's time-zone database.
  • Overtime settings in the timecard are your own threshold and multiplier, not any jurisdiction's legal rule.
  • One day is exactly 24 hours in the unit converter; calendar effects belong to the dated calculation instead.

Author: Ugo Candido · Editorial review: Ugo Candido, Founder & Editor-in-Chief () · Technical review: 137 dedicated hours-engine, share-state and renderer tests on every build, including golden reference vectors, daylight-saving vectors and a cent-exact pay check verified against an independent BigInt reference · Engine: hours-engine v1.0.0 · Share format: v1

External professional review: Internal editorial and technical review completed 2026-08-14 by Ugo Candido, covering the overnight, break, rounding and pay-precision rules and the calculation receipts. No external payroll or legal professional has reviewed the page — for jurisdiction-specific overtime rules, use the Overtime Calculator. See the public changelog.

Limitations

Frequently asked questions

How do I calculate hours between two times?

Subtract the start from the end, and add 24 hours if the end falls on the following day. Convert both to the 24-hour clock first so nothing depends on AM and PM: 5:30 PM − 9:00 AM becomes 17:30 − 09:00 = 8 hr 30 min. Take off unpaid break time last, because a break reduces worked time without changing the elapsed interval.

How many hours is 9 AM to 5 PM?

Eight hours, or 480 minutes, or 8.00 decimal hours. With a 30-minute unpaid lunch it is 7 hr 30 min, 450 minutes and 7.50 decimal hours — which is the figure a timesheet usually wants.

How many hours is 8 AM to 5 PM?

Nine hours gross. That is the shift people usually describe as "nine to five with an hour for lunch": deduct a 60-minute unpaid break and the worked time is 8 hr, 480 minutes, 8.00 decimal hours.

How many hours is 11 PM to 7 AM?

Eight hours. The end time is earlier on the clock than the start, so the end is the next morning: (24:00 − 23:00) + 07:00 = 1 + 7 = 8 hr. This calculator states that it made the overnight reading instead of applying it silently.

How do I calculate hours worked?

Add up every work period, then subtract the unpaid break time. Keep the three numbers apart: total clocked time is what the time clock says between clocking in and clocking out, unpaid breaks are what comes off, and worked time is what is left. A week of 42 hr 30 min clocked with 2 hr 30 min of unpaid breaks is 40 hr 00 min worked.

How do I subtract a lunch break?

Either enter the total unpaid minutes, or enter the break's real start and end times. Times are stricter and better for a timesheet: the calculator checks the break sits inside the work period, refuses two breaks that overlap, and refuses a break longer than the shift rather than quietly producing a smaller answer.

How do I convert hours and minutes to decimal hours?

Divide the minutes by 60 and add them to the hours: decimal hours = hours + minutes ÷ 60 + seconds ÷ 3600. 8 hr 15 min is 8 + 15 ÷ 60 = 8.25. The trap is treating 8 hr 15 min as "8.15", which is wrong by six minutes on every entry it touches.

What is 7 hours 30 minutes in decimal hours?

7.5 hours. Thirty minutes is half an hour, so 30 ÷ 60 = 0.5. In the same family: 15 min is 0.25, 20 min is 0.3333, 45 min is 0.75 and 6 min is exactly 0.1 — which is why six-minute rounding is common in professional billing.

How do I calculate overnight work hours?

Count the time to midnight and add the time after it: (24:00 − start) + end. A 10:30 PM to 6:15 AM shift is 1 hr 30 min plus 6 hr 15 min, so 7 hr 45 min. Entering the two clock times here does exactly that and labels the result as an overnight shift.

Is 12 AM midnight or noon?

12 AM is midnight — 00:00 — and 12 PM is noon, 12:00. The ambiguity is the reason this calculator converts both to the 24-hour clock before any arithmetic runs. If a schedule really matters, writing 00:00 or 23:59 removes the doubt entirely.

How do I calculate military time?

Military and 24-hour time are the same clock written without a colon: 0900 is 9:00 AM, 1730 is 5:30 PM, and anything after 1200 is the afternoon hour minus 12. Subtracting two 24-hour times needs no AM/PM reasoning at all, which is why this engine converts to it internally. Typing 0900 or 1730 into the fields here works directly.

How many minutes are in an hour?

Sixty — which is also how you convert hours to minutes: multiply by 60, so 7.25 hours is 435 minutes. It is why a decimal hour is not a clock reading: 1.5 hours is 1 hr 30 min, not 1 hr 50 min, and 0.75 hours is 45 min.

How many hours are in a week?

168 — seven days of 24 hours. A day is 24, a 365-day year is 8,760 and a leap year is 8,784. A month has no single answer: 28 days is 672 hours, 29 is 696, 30 is 720 and 31 is 744, and the average Gregorian month works out to about 730.49 hours.

How do I add hours and minutes?

Add the hours and the minutes separately, then carry every 60 minutes into an hour. 2 hr 45 min plus 1 hr 30 min is 3 hr 75 min, which carries to 4 hr 15 min. The Add / Subtract mode does this on any number of rows and lets each row be positive or negative, so 8 hr 30 min − 1 hr 45 min = 6 hr 45 min.

What time will it be X hours from now?

Add the hours to the current instant rather than to the clock face, so a wrap past midnight and a daylight-saving change are both handled. The From Now / Until mode reads the clock in your browser when the page loads, shows the resulting date and weekday, and can count from a date and time you choose instead.

Does daylight saving time affect hours between two dates?

Yes, and only for dated calculations. On a spring-forward day a local midnight-to-midnight interval is 23 hours, and on a fall-back day it is 25, even though the calendar shows one day in both cases. When dates are supplied this calculator computes elapsed time between real instants and reports the calendar figure separately whenever the two disagree. Undated clock times carry no zone, so the question does not arise.

Should work hours be rounded?

Exact is the default here, and it is the safest answer. If your employer or client rounds, choose the increment and the calculator shows the rounding as its own step. Note that rounding each punch is not the same operation as rounding the final total: 9:07 in and 4:52 out rounds to 9:00–5:00 as entries, which is not what rounding the elapsed duration alone would give.

Can I calculate multiple shifts in one day?

Yes. In Work Hours each day holds as many work periods as you need, so an 8:00–12:00 and 13:00–17:00 split shift is entered as two real periods totalling 8 hr, rather than being flattened into one 8:00–17:00 entry with an invented hour of break. Two periods that overlap each other are refused rather than added together, because summing them would pay the shared minutes twice.