Skip to content

Hours Calculator

Creator

Sufi Inam Ul Hassan, Founder

Reviewer

Syeda Kinza Batool, Co-founder
Updated
Shift times

Hours between two dates

Works out the elapsed hours across any number of days, not just one calendar day.

Start
End

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 converted to decimal hours at every 5-minute step (part 1 of 2)
MinutesDecimal hours
50.08
100.17
150.25
200.33
250.42
300.50
Minutes converted to decimal hours at every 5-minute step (part 2 of 2)
MinutesDecimal hours
350.58
400.67
450.75
500.83
550.92
601.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?

Enter the start time from the evening it began and the end time from the morning it ended, exactly as they appear on a clock, for example 22:00 as the start and 06:00 as the end. The calculator notices the end time is earlier than the start time and treats that as the shift spilling into the next day, adding 24 hours before working out the elapsed time, rather than returning a negative number.

How do I convert decimal hours to minutes for payroll?

Multiply the decimal hours by 60. For example, 8.5 decimal hours is 8.5 x 60 = 510 minutes, which matches the 8:30 shown in H:MM format. Most payroll systems accept decimal hours directly, so the decimal figure either calculator on this page shows next to the H:MM duration can usually be entered as is.

What is the difference between this and the Time Card Calculator?

The calculators on this page work out one span at a time, whether that is a single shift or a longer stretch between two full dates. The Time Card Calculator is built for a full weekly timesheet, where a start time, end time, and break are entered for several days at once and totalled into a week with pay attached. Use this page for a single check, and the Time Card Calculator when a weekly total with pay is needed.

Why does entering the same start and end time show a zero-length shift instead of a full 24 hours?

This is an honest limitation of the top calculator, which works from clock times alone rather than full dates. Starting and ending at the exact same time on a clock, such as 09:00 to 09:00, could mean either a zero-length entry or a full 24-hour shift that returned to the same clock time a day later, and the calculator has no way to tell the two apart, so it always resolves this case as zero minutes rather than guessing. The Hours Between Two Dates calculator below does not have this problem, since a full calendar date on each end says directly whether a day actually passed.

Does the break get subtracted before or after the overnight adjustment?

After. The calculator first works out the raw time between the start and end clock times, adding 24 hours if the shift crossed midnight, and only then subtracts the unpaid break minutes from that total. If the break is longer than the shift itself, an error is shown instead of a negative result.

Can I enter a break in hours instead of minutes?

The break field expects minutes. Convert a break given in hours by multiplying by 60 first, for example a 45-minute break stays as 45, while a half-hour break is entered as 30, not 0.5.

How is the Hours Between Two Dates tool different from the calculator above it?

The calculator above only knows clock times, a single start time and end time with no date attached, so it cannot represent a shift of exactly 24 hours or longer, and treats an identical start and end time as zero length rather than guessing at a full day. The Hours Between Two Dates tool below takes a full start date and time and end date and time, which removes that ambiguity entirely: a span of any length, across any number of days, comes out exactly, since the calendar dates say directly whether time has actually passed.

How many hours between two times, and how do I calculate it by hand?

Convert both times to a 24-hour clock, subtract the start from the end and, if the result is negative, add 24 hours. From 9:00 to 17:30 that is 8 hours 30 minutes, or 8.5 hours. It is the same method behind any hours between two times calculator.

Is this an hours and minutes calculator with a break?

Yes. Enter an unpaid break in minutes and it is subtracted from the elapsed time, so 9:00 to 17:30 with a 30 minute break is 8 hours, or 8.0 decimal hours. It works as an hours and minutes calculator, a work time calculator and a time clock calculator for a single shift.

Can I use it as an overnight shift calculator?

Yes. If the end time is earlier than the start time, the span is treated as crossing midnight. A shift from 22:00 to 06:00 is 8 hours, and with a 45 minute break it is 7 hours 15 minutes, or 7.25 decimal hours.

How do I convert minutes to hours?

Divide the minutes by 60. 45 minutes is 0.75 hours, 20 minutes is 0.33 and 50 minutes is 0.83. The table above lists every 5 minute step, which is the quickest way to handle minutes to hours for a timesheet.

What is the difference between a time duration calculator and an hours calculator?

They use the same arithmetic. A time duration calculator, an elapsed time calculator and a time difference calculator all measure the gap between two points in time; this page shows the result as hours and minutes and as decimal hours, which suits timesheets.

How do I calculate hours between two dates?

Use the second tool: enter both dates and times and read the total hours, which can exceed 24. It answers how many hours are in a long span, for example 3 days and 4 hours is 76 hours.

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.