ThisCalculator

Everyday

Work Out Hours and Minutes From Time

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

This calculator works out the duration between two clock times and shows the result as hours and minutes. You enter a start time and an end time (in 24-hour format), and you get back the elapsed time in hours and minutes, plus the same duration expressed in decimal hours and total minutes.

Formula

The core calculation is simple subtraction: Duration = End time − Start time. Both times are first converted to minutes after midnight. For example, 9:00 becomes 540 minutes (9 × 60), and 17:30 becomes 1,050 minutes (17 × 60 + 30). The difference is 510 minutes, which is 8 hours and 30 minutes.

In symbols: let S be the start time in minutes after midnight, and E be the end time in minutes after midnight. Then:

  • Total minutes = E − S
  • Hours = floor(Total minutes ÷ 60)
  • Remaining minutes = Total minutes mod 60

If the end time is earlier than the start time (for example, a shift that crosses midnight), the calculator assumes the end time is on the next day and adds 24 hours (1,440 minutes) to the end time before subtracting.

Worked Example

Using the default values from the calculator: start at 9:00 and end at 17:30.

  1. Convert start: 9:00 → 9 × 60 = 540 minutes.
  2. Convert end: 17:30 → 17 × 60 + 30 = 1,050 minutes.
  3. Subtract: 1,050 − 540 = 510 minutes.
  4. Divide by 60: 510 ÷ 60 = 8.5 hours, which is 8 hours and 30 minutes (since 0.5 × 60 = 30).

The calculator shows the duration as 8:30 (h:mm), decimal hours as 8.50, and total minutes as 510. That matches the manual calculation.

When to Use This Calculation

You need this whenever you have two clock times and want the elapsed time between them. Common situations include:

  • Calculating how long a work shift lasted (e.g., 9:00 AM to 5:00 PM).
  • Figuring out travel time between a departure and arrival time.
  • Tracking study sessions, meetings, or appointments.
  • Computing cooking time when a recipe gives start and end times.
  • Converting a time span into decimal hours for payroll or billing (many systems use decimal hours, not h:mm).

The result is a duration, not a clock reading. For example, 8:30 means “eight and a half hours,” not “half past eight.”

How to Read the Result

The main output is shown as h:mm (hours and minutes). The decimal hours output is useful when you need to multiply by an hourly rate or add multiple durations. For instance, 8:30 is 8.5 hours in decimal form. To convert manually: take the minutes, divide by 60, and add to the hours. So 30 ÷ 60 = 0.5, giving 8.5.

If you need to add several durations, convert each to decimal hours first, sum them, then convert back if necessary. For example, 2:15 + 1:45 = 2.25 + 1.75 = 4.0 hours, which is 4:00.

Be careful with AM/PM. The calculator uses 24-hour time, so 3:00 PM is 15:00. If you enter 3:00 instead of 15:00, you will get a negative result (or a large positive result if the calculator assumes the next day).

Common Mistakes and How to Avoid Them

One frequent error is mixing 12-hour and 24-hour formats. Always convert PM times to 24-hour by adding 12 to the hour (except 12 PM, which stays 12). Another mistake is forgetting that midnight is 0:00, not 24:00. If a shift starts at 11 PM and ends at 7 AM, you must enter 23:00 and 7:00; the calculator will add 24 hours to the end time because 7 < 23.

Rounding can also cause problems. If you round decimal hours too early, you may lose minutes. For instance, 7:50 is 7.833… hours. Rounding to 7.8 loses 2 minutes. Keep full precision until the final step, or use the total minutes output.

Another pitfall: when subtracting times that span midnight, do not simply subtract the start from the end if the end is smaller. Add 24 hours to the end first. The calculator does this automatically, but if you are doing it by hand, remember the rule.

Limitations and Edge Cases

The calculator assumes both times are on the same day unless the end time is earlier than the start time, in which case it treats the end as the next day. It does not handle multiple days. For durations longer than 24 hours, you need a different approach—for example, subtract the start time from midnight, add the end time, and add the number of full days in between.

The calculator also ignores seconds. If you need precision to the second, you should convert everything to seconds first, then convert back. For most everyday uses, minutes are sufficient.

If the start and end times are identical, the duration is zero. That is correct—no time has elapsed.

Alternative Methods

If you do not have a calculator, you can do the math manually using the steps in the worked example. Many spreadsheet programs (like Excel or Google Sheets) have built-in functions for time differences. In Excel, you can subtract one time cell from another and format the result as [h]:mm to show hours over 24. On a phone, you can use the stopwatch or timer app to measure elapsed time directly, though that requires you to start and stop at the right moments.

For repeated calculations, a spreadsheet formula is often more convenient than a calculator. For example, if cell A1 has the start time and B1 the end time, =B1-A1 formatted as [h]:mm gives the duration. But be aware that spreadsheet time values are fractions of a day, so 0.5 means 12 hours.

Frequently Asked Questions

How do I convert minutes to hours and minutes?

Divide the total minutes by 60. The whole number is the hours, and the remainder is the minutes. For example, 135 minutes ÷ 60 = 2 with a remainder of 15, so 2 hours and 15 minutes.

What is the difference between 12-hour and 24-hour time?

In 12-hour time, the day is split into two 12-hour periods labeled AM and PM. In 24-hour time, the hours run from 0 to 23. To convert PM hours to 24-hour, add 12 (except 12 PM, which is 12). For example, 3 PM is 15:00, and 12 AM is 0:00.

How do I calculate hours worked across midnight?

If the end time is earlier than the start time, add 24 hours to the end time before subtracting. For example, 10 PM to 6 AM: 6 + 24 = 30, then 30 − 22 = 8 hours.

Why is my result negative?

You likely entered a start time later than the end time without intending to cross midnight. Check that you are using 24-hour format and that the end time is later. If you did mean to cross midnight, the calculator handles it automatically.

Can I use this for durations longer than 24 hours?

No, this calculator only works for durations within a single day or crossing one midnight. For longer periods, use a date-based calculator or a spreadsheet that includes dates.

What is decimal hours and why is it used?

Decimal hours express time as a fraction of an hour, such as 8.5 instead of 8:30. It is common in payroll because multiplying by an hourly rate is simpler with decimals. To convert minutes to decimal, divide by 60.

Related

Formula used
in t | Start time (HH:MM) | - | 9:00 | 0
in d | End time (HH:MM) | - | 17:30 | 0
out dur | Duration | h:mm | max(0, (d - t)) | time
out dec | Decimal hours | h | (d - t) / 60 | 2
out tot | Total minutes | min | d - t | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.