Hours Calculator
Creator
Reviewer
Hours between two dates
Works out the elapsed hours across any number of days, not just one calendar day.
This hours calculator works out how many hours and minutes passed between a start time and an end time. It handles an overnight shift that crosses midnight correctly, and lets you subtract an unpaid break so the result matches the time you actually worked. A second calculator below covers the fuller version of the same question, hours between two dates, for a span that runs longer than one calendar day.
Fill in the fields and press Calculate on either tool to see the elapsed duration, shown above the fields as hours and minutes and as decimal hours.
Many people land on this hour calculator online while searching for a plain time worked calculator or shift calculator to check hours between two times worked in a single day. The full weekly version, the time card hours calculator, lives on its own page for totalling several days of shifts with pay attached, and the sibling time calculator instead adds or subtracts a block of time from a date rather than measuring the gap between two clock times.
How the hours calculator measures elapsed time
Both the start time and the end time are converted to the number of minutes since midnight. A start of 09:00 becomes 9 x 60 = 540 minutes, and an end of 17:30 becomes 17 x 60 + 30 = 1050 minutes. Subtracting the start from the end gives the raw duration: 1050 − 540 = 510 minutes, which is 8 hours and 30 minutes, or 8.5 decimal hours.
An overnight shift needs one extra step. If the end time is earlier than the start time, that on its own does not mean something went wrong, it means the shift crossed midnight into the next day. Take a shift starting at 22:00 and ending at 06:00: the start is 22 x 60 = 1320 minutes and the end is 6 x 60 = 360 minutes. A plain subtraction gives 360 − 1320 = −960, which is not a real duration. The calculator recognizes the negative result, adds a full day of 1440 minutes back in, and gets 480 minutes, which is exactly 8 hours. That is the same worked example this tool's own tests are built against, so an entry of 22:00 to 06:00 will always come back as 8:00 and 8.0 decimal hours.
Because the calculator only knows clock times, not full dates, it cannot always tell whether a shift crossed midnight. If the end time is later than the start time, the shift is assumed to fit within the same day. If it is earlier, it is assumed to have crossed into the next day. That assumption is correct for a normal single shift, but it does mean the tool cannot represent a shift longer than 24 hours.
How the unpaid break deduction works
Once the raw duration between the start and end time is worked out, including the overnight adjustment if any, the unpaid break in minutes is subtracted from it directly. Using the earlier 09:00 to 17:30 example with a 30-minute lunch break: 510 − 30 = 480 minutes, or exactly 8 hours. Leave the break field blank or at zero if none applies.
If the break is longer than the shift itself, for example a 45-minute break entered against a 30-minute shift from 09:00 to 09:30, the calculator does not return a negative number of hours. It flags the entry as an error instead, since a break cannot consume more time than the shift contained.
One honest limitation is worth calling out plainly: entering the same clock time for both the start and the end, such as 09:00 to 09:00, is always treated as a zero-length shift, never as a full 24-hour shift that happened to return to the same clock time a day later. Working from clock times alone, the calculator has no way to distinguish those two cases, so it always resolves the tie as zero rather than guessing. The next section covers the calculator that removes this limitation entirely.
Hours between two dates: shifts and spans longer than a day
The second calculator on this page takes a full start date and time and a full end date and time, rather than clock times alone. That one change removes every piece of guesswork the top calculator has to make: there is no midnight-direction assumption to get right, and an identical start and end no longer needs to be resolved as zero versus a full day, since the calendar dates state directly whether a day actually passed. It is the version of this calculator built for a 24-hour on-call rotation, a multi-day project, a long-haul travel shift, or any other span that a single pair of clock times cannot represent on its own.
Worked example. A shift starts at 09:00 on 1 January and ends at 17:30 on 3 January, the same clock times as the earlier example but two calendar days later. That is 2 full days (2,880 minutes) plus 8 hours and 30 minutes (510 minutes) on top, for 3,390 minutes in total. Read as days, hours and minutes, that is 2 days, 8 hours and 30 minutes, or 56.5 decimal hours, the figure a payroll or billing system would actually use.
The decimal-hours figure works exactly the same way here as in the calculator above: multiply the whole-number hours and minutes-as-a-fraction-of-sixty and add them together, or just read it straight off the result, since both calculators compute and display it automatically. That is the number worth copying into a payroll system, a client invoice, or a total-hours-worked spreadsheet, since decimal hours multiply directly by an hourly rate, while an H:MM figure like 8:30 does not.
This is the same calculation whether it gets called an hours worked calculator, a clock in clock out calculator, or a plain shift length calculator, and whether the shift itself is a normal day shift, an overnight shift, or a 24-hour on-call rotation. A team spread across time zones adds one extra step before any of this: convert every clock-in and clock-out time to a single shared zone first, using something like the site's time zone calculator, since two people 8 hours apart who both clocked in at "9:00" local time were not actually working the same 8 hours.
Using this calculator for freelance and hourly billing
Payroll is not the only place a clock-in and clock-out time needs turning into a number. Freelancers and contractors billing by the hour run the same calculation, just against a client invoice instead of a paycheck: log the start and end time for each work block, let the calculator handle any block that happens to run past midnight, and read off the decimal-hours figure to multiply directly by an hourly rate. A design session that runs from 14:20 to 18:50 comes to 4 hours and 30 minutes, or 4.5 decimal hours, which at a $75 hourly rate is exactly $337.50, a cleaner multiplication than working from the H:MM figure directly.
Several short blocks across a day add the same way a single shift does: work out each block's decimal hours separately, then add the decimals together rather than the H:MM figures, since decimal hours are the only one of the two formats that behaves correctly under plain addition. Two blocks of 1.75 and 2.25 decimal hours add cleanly to 4.0; the same two blocks written as 1:45 and 2:15 still add to the same real duration, but only after converting back to minutes first, which is exactly the conversion this calculator already does automatically on every entry.
Reading the result: H:MM versus decimal hours
Both calculators on this page show the same duration two ways: as hours and minutes, 8:30, and as a decimal, 8.5. Both describe the same length of time, just written for different audiences. H:MM is how a clock or a calendar naturally shows a duration, while decimal hours is what a payroll system, a spreadsheet or an hourly rate actually needs, since multiplying a decimal figure by a dollar or rupee amount gives a wage directly, while multiplying 8:30 by a rate does not.
Converting between the two just means treating minutes as sixtieths of an hour rather than hundredths. The table below gives the decimal value at every 5-minute mark, useful as a quick lookup instead of dividing by 60 each time.
| Minutes | Decimal hours |
|---|---|
| 5 | 0.08 |
| 10 | 0.17 |
| 15 | 0.25 |
| 20 | 0.33 |
| 25 | 0.42 |
| 30 | 0.50 |
| Minutes | Decimal hours |
|---|---|
| 35 | 0.58 |
| 40 | 0.67 |
| 45 | 0.75 |
| 50 | 0.83 |
| 55 | 0.92 |
| 60 | 1.00 |
Both calculators round decimal hours to two decimal places, matching how most payroll and invoicing software displays them. For the fuller picture, including how many employers round clock times before this conversion even happens, the guide on how to calculate hours worked for payroll covers quarter-hour rounding, overtime thresholds and the mistakes that most often make a paycheck wrong.
Frequently asked questions
How do I enter an overnight shift that crosses midnight?
How do I convert decimal hours to minutes for payroll?
What is the difference between this and the Time Card Calculator?
Why does entering the same start and end time show a zero-length shift instead of a full 24 hours?
Does the break get subtracted before or after the overnight adjustment?
Can I enter a break in hours instead of minutes?
How is the Hours Between Two Dates tool different from the calculator above it?
How many hours between two times, and how do I calculate it by hand?
Is this an hours and minutes calculator with a break?
Can I use it as an overnight shift calculator?
How do I convert minutes to hours?
What is the difference between a time duration calculator and an hours calculator?
How do I calculate hours between two dates?
Related tools: Time Calculator, Time Duration Calculator and Date Calculator. More are grouped under Everyday Calculators, and every tool on the site is listed at all calculators.
