Time Calculator

Add, subtract, and convert time with support for both 12-hour and 24-hour formats, plus decimal hour conversion for payroll.

Result
Total Hours
Total Minutes
Total Seconds
Decimal Hours

How to Use the Time Calculator

Perform time calculations quickly and accurately with support for both 12-hour and 24-hour time formats.

  1. Choose your time format: Toggle between 12-hour (AM/PM) and 24-hour format based on your preference.
  2. Select an operation: Add Time, Subtract Time, or calculate the Time Between two times.
  3. Enter time values: Fill in hours, minutes, and seconds. For 12-hour format, select AM or PM.
  4. View results: See the result time plus breakdowns in total hours, minutes, seconds, and decimal hours.

Time Calculation Formulas

Adding time:

Result (seconds) = Start Time (seconds) + Added Time (seconds)

Subtracting time:

Result (seconds) = Start Time (seconds) - Subtracted Time (seconds)

Time difference (between two times):

Difference = Time 2 (seconds) - Time 1 (seconds)

Converting to decimal hours:

Decimal Hours = Hours + (Minutes ÷ 60) + (Seconds ÷ 3600)

Converting 12-hour to 24-hour format:

24h Hour = 12h Hour + 12 (if PM and not 12 PM) 24h Hour = 0 (if 12 AM)

All time calculations internally convert to total seconds, perform the arithmetic, then convert back to hours, minutes, and seconds for display. For time-between calculations, if Time 2 is earlier in the day than Time 1, the calculator adds 24 hours to Time 2 to handle overnight spans.

What is Time Calculation?

Time calculation involves adding, subtracting, and comparing time values. Unlike regular arithmetic, time operates on a base-60 system (60 seconds per minute, 60 minutes per hour) rather than base-10. This makes manual time math error-prone, especially when carrying over minutes to hours or handling AM/PM conversions.

Common applications include payroll processing (calculating total work hours), project management (summing task durations), cooking and baking (adding prep and cook times), fitness tracking (totaling workout durations), and travel planning (calculating arrival times across time zones).

The decimal hours output is particularly important for payroll systems, which require time in decimal format rather than hours and minutes. For example, an employee who works 7 hours and 45 minutes should be recorded as 7.75 decimal hours for accurate wage calculation.

Understanding Decimal Hours

Decimal hours express time as a decimal number instead of hours and minutes. This format is commonly used for payroll, billing, and time tracking systems.

Examples:

  • 1 hour 30 minutes = 1.5 decimal hours
  • 2 hours 15 minutes = 2.25 decimal hours
  • 45 minutes = 0.75 decimal hours
  • 8 hours 45 minutes = 8.75 decimal hours

Conversion formula: Decimal hours = Hours + (Minutes ÷ 60) + (Seconds ÷ 3600)

For example, 2 hours 30 minutes 45 seconds = 2 + (30 ÷ 60) + (45 ÷ 3600) = 2.5125 decimal hours

Common Time Calculation Scenarios

ScenarioOperationExample
Calculate total work hoursTime Between9:00 AM to 5:30 PM = 8.5 hours
Add overtime hoursAdd Time8:00 hours + 2:30 hours = 10:30 hours
Calculate time remainingSubtract Time4:00 hours - 1:45 hours = 2:15 hours
Convert to decimal for payrollAny operation7 hours 45 minutes = 7.75 decimal hours
Project time trackingAdd Time2:30 + 3:15 + 1:45 = 7:30 hours total

Frequently Asked Questions

What is the difference between 12-hour and 24-hour time?
12-hour time uses AM (ante meridiem, before noon) and PM (post meridiem, after noon), with hours from 1-12. 24-hour time (military time) uses hours from 00-23 without AM/PM. For example, 2:30 PM in 12-hour format is 14:30 in 24-hour format.
How do I convert time to decimal hours for payroll?
The calculator automatically shows decimal hours in the results. Divide minutes by 60 to get the decimal. For example, 30 minutes = 0.5 hours, 15 minutes = 0.25 hours, 45 minutes = 0.75 hours.
Can I add more than 24 hours?
Yes! The calculator can handle any amount of time. If you add hours that exceed 24, the result will show the total correctly. For example, adding 20 hours to 10:00 gives you 30:00 (or 1 day and 6 hours).
What if I subtract more time than I have?
If you subtract more time than the start time, the result will be negative. This can be useful for calculating time deficits or overruns. The calculator will show the negative result clearly.
How do I calculate time across midnight?
Use the "Time Between" operation. Enter the earlier time as Time 1 and the later time as Time 2. If Time 2 is earlier in the day than Time 1, the calculator assumes it's the next day. For example, 11:00 PM to 2:00 AM = 3 hours.
Can I use this for cooking or workout timers?
Yes! Use the "Add Time" operation to add cooking or workout durations. Start with your current time and add the duration needed. The result shows exactly what time you'll finish.
Is my data stored anywhere?
No. All calculations are performed entirely in your browser using JavaScript. No times or data are sent to any server or stored anywhere.