Hours Calculator
Worked time: 9 hours 0 minutes
- Duration
- 9 hours 0 minutes
- Decimal hours
- 9
- Total minutes
- 540
- Overnight shift
- No
What this calculator does
The Hours Calculator measures the time between a start time and an end time on a 12-hour clock. It returns the gap in hours and minutes, the same value as decimal hours, and the total number of minutes. If the end time is earlier than the start time, the shift is treated as crossing midnight.
This is the simple daily version of a time card. It is designed for quick checks: a shift from 8:30 AM to 5:30 PM is nine hours, and a shift from 10:00 PM to 6:30 AM is eight hours and thirty minutes.
How to use this calculator
- Enter the start time as hours and minutes, such as 8:30.
- Choose AM or PM for the start period.
- Enter the end time and choose its period.
- Click Calculate.
The default example is 8:30 AM to 5:30 PM. The result is 9 hours, 0 minutes, 540 total minutes, and 9.00 decimal hours. No overnight adjustment is needed.
Hours formulas
Start minutes = (hour mod 12) × 60 + minutes
End minutes = (hour mod 12) × 60 + minutes
If start is PM: add 12 × 60 to start minutes
If end is PM: add 12 × 60 to end minutes
Elapsed = end minutes - start minutes
If elapsed < 0: elapsed = elapsed + 1,440
Hours = floor(elapsed / 60)
Minutes = elapsed mod 60
Decimal hours = elapsed / 60
Midnight is handled by the 12-hour conversion: 12:00 AM becomes 0 minutes after midnight, and 12:00 PM becomes 720 minutes. The overnight rule triggers only when the end time is strictly earlier than the start time. Two identical times therefore produce zero hours rather than a full day.
What the results mean
The headline shows a readable hours-and-minutes duration. The summary adds decimal hours, which is the form many payroll and billing systems use, and total minutes, which is convenient for rounding rules. An overnight flag confirms whether the end time was interpreted as the following day.
For example, a shift from 11:45 PM to 12:15 AM produces 30 total minutes and an overnight flag. A shift from 9:00 AM to 9:00 AM produces zero.
Assumptions and limitations
- Times use a 12-hour clock with an explicit AM or PM period.
- Hours must be from 1 to 12, and minutes must be from 0 to 59.
- Break time is not deducted in this calculator; use the Time Card Calculator for unpaid breaks.
- The result assumes the shift ends on the same day or the immediately following day. It does not handle multi-day gaps.
- Daylight saving transitions are not modeled, because only clock times are entered.
Frequently asked questions
How do I calculate an overnight shift?
Enter the start time with PM and the end time with AM. For example, 10:00 PM to 6:30 AM is treated as crossing midnight and returns 8 hours and 30 minutes.
Why do two identical times return zero?
The calculator measures elapsed time. If the start and end are the same, no time has passed. If you intend a full 24-hour period, enter 12:00 AM to 12:00 AM only after confirming that a zero result is not acceptable for your use case.
Should I subtract a lunch break?
This page does not subtract breaks. If you need a break deduction and weekly overtime, use the Time Card Calculator, which accepts a break in minutes for each day.
Reference table
Time entry examples
| Start Time: | AM PM Now |
|---|---|
| 8:00 | AM |
| 12:30 | PM |
| 5:15 | PM |
| 9:00 | AM next day |
Time card example
| Description | Hours |
|---|---|
| Monday | 8.0 |
| Tuesday | 7.5 |
| Wednesday | 8.0 |
| Thursday | 8.0 |
| Friday | 6.5 |
| Total | 38.0 |
A 30-minute unpaid break is 0.5 hours. Convert minutes to decimal hours by dividing by 60.
Source
Reference: Calculator.net — Hours Calculator.
Other Calculators
- Age Calculator
- Date Calculator
- Time Calculator
- Hours Calculator
- Time Card Calculator
- Time Zone Calculator
- Time Duration Calculator
- Day of the Week Calculator
- Concrete Calculator
- BTU Calculator
- Square Footage Calculator
- Stair Calculator
- Roofing Calculator
- Tile Calculator
- Mulch Calculator
- Gravel Calculator
- Height Calculator
- Conversion Calculator
- More Other Calculators