Hours Calculator

How many hours between two times?

Calculate the exact hours and minutes between any start and end time, automatically handling overnight shifts and day crossings for accurate time tracking.

Updated June 2026 · How this works

Example calculation — edit any field to use your own numbers

Worth knowing
How It Works
The formula, explained simply

Think of time calculation like measuring distance on a clock face. When you drive from mile marker 10 to mile marker 50, you traveled 40 miles. Similarly, from 2:00 PM to 6:00 PM, you worked 4 hours. The calculator converts times to minutes since midnight, subtracts start from end, then converts back to readable hours and minutes.

The tricky part happens with overnight shifts. If you start at 11 PM and end at 3 AM, the calculator recognizes that 3 AM means the next day. It adds 24 hours to the end time before calculating the difference. This prevents the impossible result of negative hours.

Decimal hours appear because payroll systems and billing software often require time in decimal format. Instead of 8 hours and 30 minutes, you need 8.5 hours. The calculator provides both formats so you can use whichever your system requires without manual conversion.

When To Use This
Right tool, right situation

Use this calculator for any time tracking that requires precision: employee timesheets, freelance billing, project management, or study session tracking. It handles the two most common scenarios: standard day shifts and overnight shifts that cross midnight.

The calculator works perfectly for single-location time tracking where everyone uses the same timezone. It also handles any duration up to 24 hours, covering double shifts, overnight duties, or extended work sessions.

Do not use this calculator for multi-day periods, different timezone calculations, or duration tracking that includes breaks. For payroll across multiple days, calculate each day separately and sum the totals. For timezone-sensitive scheduling, convert all times to the same timezone first, then calculate duration.

Common Mistakes
Why results sometimes look wrong

The most common mistake is forgetting that 0.5 hours equals 30 minutes, not 50 minutes. People often think 1.3 hours means 1 hour and 30 minutes, when it actually means 1 hour and 18 minutes. This decimal confusion leads to payroll errors and billing disputes.

Another frequent error involves overnight calculations. Many people manually calculate 11 PM to 3 AM as 4 hours by counting backwards, but then double-check by going forward and get confused. The key insight is that any end time before start time automatically means the next day.

Rounding creates the third major mistake. Some people round 37 minutes to 40 minutes for easier math, but this 3-minute error compounds across multiple shifts. Over a two-week pay period, this could mean 30 minutes of unpaid time or overpayment, depending on the rounding direction.

The Math
Worked examples and deeper derivation

Time calculation uses base-60 arithmetic inherited from ancient Babylonian mathematics. Unlike our base-10 number system, time counts 60 minutes per hour and 60 seconds per minute. This creates conversion complexity that most people handle poorly without a calculator.

To convert minutes to decimal hours, divide by 60. To convert decimal hours back to hours and minutes, multiply the decimal portion by 60. For example, 2.75 hours equals 2 hours plus 0.75 × 60 = 45 minutes. The calculator performs these conversions instantly while avoiding rounding errors.

Crossing midnight adds another layer of complexity. The calculator treats any end time earlier than start time as occurring the next day. This assumes a maximum 24-hour duration, which covers nearly all real-world time tracking scenarios. For longer periods, break the calculation into multiple days.

Calculating overtime hours for payroll
Start: 7:30 AM, End: 6:15 PM
Shows 10 hours, 45 minutes (10.75 decimal hours). Since this exceeds 8 hours, 2.75 hours qualify as overtime at 1.5x pay rate.
Night shift duration for scheduling
Start: 11:00 PM, End: 7:00 AM
Shows 8 hours exactly. The calculator automatically recognizes that 7:00 AM is the next day, not 4 hours before the start time.
Project time tracking for billing
Start: 1:20 PM, End: 4:50 PM
Shows 3 hours, 30 minutes (3.5 decimal hours). Bill client for 3.5 hours at your hourly rate, or round up to 4 hours depending on your billing policy.
Expert Unlock
The thing most explanations skip

Professional time tracking systems often require 15-minute increments for billing purposes. If your result shows 2 hours and 37 minutes, you might need to round to 2 hours and 45 minutes depending on your billing policy. Some industries round down, others round up, and some round to the nearest quarter-hour.

How does the hours calculator handle overnight shifts?

What if my end time is before my start time?
The calculator automatically assumes the end time is the next day. For example, starting at 11 PM and ending at 3 AM calculates as 4 hours, not negative time.
Can I calculate hours for shifts longer than 24 hours?
This calculator is designed for single-day periods up to 24 hours. For multi-day calculations, use separate calculations for each day and add the totals together.
How accurate is the decimal hours conversion?
The decimal conversion is mathematically exact. 30 minutes always equals 0.5 hours, 15 minutes equals 0.25 hours, and 45 minutes equals 0.75 hours.

Need something this doesn't cover?

Suggest a tool — we'll build it →