Add, subtract, and calculate time differences
Add, subtract, and find the difference between two time durations without the headache of base-60 arithmetic. Enter each duration in hours, minutes, and seconds, choose an operation, and get a precise HH:MM:SS result that handles carrying and borrowing automatically.
Initializing in your browser…
Calculate exact age in years, months, and days. Find date differences, countdowns, zodiac signs, and detailed time breakdowns
Calculate aspect ratios, resize dimensions while maintaining proportions. Common presets for video, photo, mobile screens, and social media
Advanced calculator with scientific functions and history
You are tallying billable time and need to add 2 h 45 m and 1 h 30 m, then know the decimal hours.
Input
2:45 + 1:30
Result
4:15 (= 4.25 hours)
Time arithmetic carries in base 60, so 45 + 30 minutes rolls into an extra hour rather than "75". The tool also converts the total to decimal hours, which is what timesheets and invoices usually require.
Add, subtract, and find the difference between two time durations without the headache of base-60 arithmetic. Enter each duration in hours, minutes, and seconds, choose an operation, and get a precise HH:MM:SS result that handles carrying and borrowing automatically.
The Time Calculator works on hours/minutes/seconds and supports three operations selected by radio button: Add Times, Subtract Times, and Time Difference. Internally it never does base-60 column arithmetic directly. Instead, both inputs are flattened to a single total-seconds value with h*3600 + m*60 + s, the chosen operation runs on those integers, and the result is rebuilt with Math.floor(total/3600) for hours, Math.floor((total%3600)/60) for minutes, and total%60 for seconds. This is why overflow is normalized automatically: entering 1h 45m and adding 30m yields 2:15:00 rather than 1:75:00, and 90 seconds rolls up to 1 minute 30 seconds without any manual carry.
Inputs are parsed with parseInt, so the tool is whole-second only - there is no millisecond or decimal-second support, and any blank or non-numeric field falls back to 0 via the || 0 guard rather than erroring. The minutes and seconds boxes carry a max="59" attribute while hours is unbounded, but the math itself does not reject out-of-range values; if you type 90 minutes it is simply converted (1h 30m), so the field caps are input hints rather than hard validation. One real edge case to know: Subtract Times and Time Difference behave identically when Time 2 is larger than Time 1. The secondsToTime helper wraps the total in Math.abs before splitting it, so a negative subtraction result is displayed as its absolute value with no minus sign - subtracting 1:00:00 from 0:30:00 shows 00:30:00, exactly the same as the Difference mode.
Results are rendered in two synchronized forms: a large zero-padded HH:MM:SS readout (each field run through padStart(2, '0'), so 2 hours 5 minutes shows as 02:05:00) and a plain-language line reading the raw component values, e.g. '2 hours, 5 minutes, 0 seconds'. There is no decimal-hours or total-seconds output. A row of Quick Presets fills Time 2 only - the buttons are 1 Hour, 30 Minutes, 15 Minutes, 8 Hours, and 24 Hours - which makes it fast to add or subtract a standard shift or interval from an entered Time 1. All six input fields plus the operation choice are stored in the URL query string via useUrlStates, so a populated calculation can be shared or bookmarked through the Share button and reopened with the same values.
Set Time 1 to 4h 30m, choose the 8 Hours preset for Time 2, and Add Times returns 12:30:00 (shown also as '12 hours, 30 minutes, 0 seconds').
Add 0h 45m 30s and 0h 30m 45s: the 75 seconds and 75 minutes carry up, producing 01:16:15 rather than 0:75:75.
Subtract Times with Time 1 = 0:30:00 and Time 2 = 1:00:00 displays 00:30:00, the same absolute result as Time Difference, because the engine wraps the total in Math.abs.
Add work durations across shifts to get a combined total.
Combine segment times to find a total event duration.
Add lap times or find the difference between two workout times.
Yes. Enter any number of hours; the result is reported in hours, minutes, and seconds with no 24-hour cap.
Fill in the hours, minutes, and seconds fields for each duration separately. Minutes and seconds are capped at 59.
No. The tool works with whole seconds. For sub-second precision, round to the nearest second before entering.
Every calculation runs locally in your browser. Your numbers and expressions are not transmitted or stored.