How the time calculator works
Three modes, one rule: every time and every duration is turned into minutes first, so measuring a span, adding two durations and shifting a clock time all use the same arithmetic.
- Between times. The calculator subtracts the start from the end. If the end is not later than the start, it adds 24 hours, so a night shift reads as a positive duration instead of a negative one.
- Add / subtract. Both durations are converted to minutes, combined with the operation you pick, and converted back to h:mm. The decimal value is the same total minutes divided by 60.
- Time + duration. The start time is shifted forward or backward by the duration. The clock wraps at midnight, and a note tells you whether the answer landed on the same day, the next day or an earlier one.
Everything runs in your browser in whole minutes, with no rounding step. The calculator sends nothing to a server, and the values you type are not stored between visits.
Formulas and rules
Duration between two times
minutes = end + 1440 − start // end ≤ start: crosses midnight
h:mm = floor(minutes ÷ 60) : (minutes mod 60)
decimal = minutes ÷ 60
An hour is 60 minutes, so a duration is already a decimal value once it is in minutes. 8 hours 30 minutes is 510 minutes, and 510 ÷ 60 = 8.50. The 30 leftover minutes are 30 ÷ 60 = 0.50 of an hour.
Adding and subtracting durations
total h:mm = formatDuration(total minutes)
// e.g. 1:45 + 2:30 = 105 + 150 = 255 min = 4:15
A result below zero keeps its sign: 1:45 minus 2:30 is −0:45, which is 45 minutes short of zero. Subtracting a longer duration from a shorter one does not borrow a day automatically, because a bare duration has no date attached to it.
Shifting a clock time
clock = ((raw mod 1440) + 1440) mod 1440
days = floor(raw ÷ 1440)
Modulo keeps the clock inside one day, and the day counter records the overflow. 10:30 AM plus 4:45 is 885 minutes, which wraps to 14:45, or 3:15 PM, on the same day.
Why 24 hours, not 23 or 25
The calculator works in plain clock arithmetic with fixed 24-hour days. Daylight saving changes, time zones and date lines are not modelled, so a span that crosses a DST switch can be off by an hour in real life even though the clock subtraction here is exact. The same applies to any span that crosses a date boundary: the tool reports the length, not the calendar days.
Worked examples
1. A same-day shift
A shift runs from 9:00 AM to 5:30 PM with no break recorded.
minutes = 510
h:mm = 8:30
decimal = 510 ÷ 60 = 8.50
2. A shift that crosses midnight
11:00 PM to 7:00 AM the next morning. The end time is earlier than the start time, so a day is added.
minutes = 1440 + 420 − 1380 = 480
h:mm = 8:00
decimal = 480 ÷ 60 = 8.00
3. Adding durations, then shifting a time
Two durations add up to the length of a meeting block, and that block then moves a start time.
1:45 − 2:30 = 105 − 150 = −45 min = −0:45
10:30 AM + 4:15 = 630 + 255 = 885 min → 14:45 = 2:45 PM
Frequently asked questions
How do I calculate the hours between two times?
Enter the start and end time and the tool subtracts them: 9:00 AM to 5:30 PM is 8 hours 30 minutes, which is 510 minutes or 8.50 decimal hours. The result shows all three formats at once.
What if the end time is earlier than the start time?
The calculator treats it as a span that crosses midnight and adds 24 hours. 11:00 PM to 7:00 AM comes out as 8:00, not as a negative number.
What happens when both times are the same?
The tool counts a full 24 hours, because an end time that is not later than the start time is read as the next day. Enter 9:00 AM and 9:00 AM to see 24:00.
Can I add and subtract durations?
Yes. Pick Add or Subtract, enter both durations as h:mm, and the total is shown in h:mm, decimal hours and minutes. 1:45 plus 2:30 is 4:15; 1:45 minus 2:30 is -0:45.
How do I add a duration to a time of day?
Use the Time + duration mode. Enter the start time and a duration such as 4:45, and the tool returns the clock time plus how many days it moved. 10:30 AM plus 4:45 is 3:15 PM.
How do I turn the result into decimal hours?
Divide the total minutes by 60. 8 hours 30 minutes is 510 minutes, and 510 divided by 60 is 8.50 decimal hours. The calculator shows both values, so you do not have to do the division yourself.
Does the calculator round times or accept seconds?
It works in whole minutes and rounds nothing, so 9:07 AM to 5:23 PM is exactly 8 hours 16 minutes. Seconds cannot be entered, and there is no punch rounding here; the time card calculator has configurable punch rounding instead.
Does this time calculator store the times I enter?
No. Everything runs in your browser, the calculator sends nothing to a server, and nothing you type is saved between visits.
Related tools
Time card calculator
Shifts, two unpaid breaks, overtime rules and gross pay for a full workweek.
ConvertDecimal hours calculator
H:MM to decimal hours and back, with a minute-by-minute conversion table.
Print firstTimesheet calculator
A printable pay-period timesheet with employer and employee fields.
ChannelTime & Pay
Every hours and pay tool on CalcChest, plus the rules behind them.