XConvert
Downloads
Pricing

Hours Between Calculator Online

Enter a start and end date/time to instantly calculate the total hours between them in your browser.

Elapsed
8.00 h
0 d, 8 h, 0 m
Total minutes480
Total seconds28800

How to Calculate Hours Between Two Times

  1. Enter the Start Time: Type the start time in 12-hour (e.g. 9:00 AM) or 24-hour (09:00) format. Add seconds if needed (9:00:30). The calculator parses both formats automatically.
  2. Enter the End Time: Type the end time the same way. If the end is earlier than the start (e.g. 11:00 PM to 7:00 AM), enable the cross-midnight option or add a date to the inputs so the calculator wraps to the next day instead of returning a negative duration.
  3. Add Dates and Break Time (Optional): Toggle on dates when your shift spans midnight or multiple days, and enter a break/lunch deduction (in minutes) to subtract from the total. Useful for an 8-hour shift with a 30-minute unpaid lunch (= 7.5 paid hours).
  4. Read the Result: The duration is shown as H hours, M minutes, S seconds, as HH:MM:SS, and as decimal hours (the format payroll, billing, and spreadsheets use). All math runs in your browser — no sign-up, no upload.

Why Calculate Hours Between Two Times?

Time-arithmetic looks simple but breaks in three places: subtracting across midnight, converting h:m into decimal hours for billing or Excel, and handling the two days per year when local time skips or repeats an hour (DST). A pocket calculator gets all three wrong; this tool gets them right.

  • Payroll and timesheets — A shift from 9:00 AM to 5:30 PM with a 30-minute unpaid lunch is 8 hours 0 minutes, or 8.00 decimal hours, the number every payroll system actually multiplies by the hourly rate.
  • Legal, consulting, and freelance billing — Industries bill in tenths of an hour: 6 minutes = 0.1 h, 15 minutes = 0.25 h, 45 minutes = 0.75 h. Entering 2:45 PM to 4:00 PM returns 1.25 h instantly, ready to drop into a billing entry.
  • Overnight and shift work — Nurses, security, and hospitality work 11 PM to 7 AM. Without a date the math reads as -16 hours; with the cross-midnight toggle it correctly returns 8 hours.
  • Cooking, brewing, and lab timing — A 14-hour bread cold-proof started at 8:30 PM finishes at 10:30 AM the next day. The calculator handles the date roll automatically when both dates are entered.
  • Scheduling against DST — On the second Sunday of March, clocks jump from 2:00 AM to 3:00 AM (so 2:30 AM doesn't exist); on the first Sunday of November they roll 2:00 AM back to 1:00 AM (so 1:30 AM happens twice). A 9 PM Saturday → 9 AM Sunday "12-hour" shift is actually 11 hours in spring and 13 hours in fall.
  • Excel and Google Sheets parity — The classic Excel formula =(End-Start)*24 produces decimal hours but returns a negative number across midnight; the calculator matches the corrected =MOD(End-Start,1)*24 formula so spreadsheet exports line up.

Minutes-to-Decimal-Hours Reference

Use this table to sanity-check decimal results or convert by hand:

Minutes Decimal hour Minutes Decimal hour
5 0.083 35 0.583
10 0.167 40 0.667
15 0.25 45 0.75
20 0.333 50 0.833
25 0.417 55 0.917
30 0.50 60 1.00

Formula: decimal hour = minutes / 60. A reading of 3h 15m is 3.25 decimal hours; 7h 45m is 7.75; 8h 20m is 8.333…. Most payroll systems round to two or three decimal places.

Time-Arithmetic Gotchas

Scenario What goes wrong What the calculator does
End time earlier than start (e.g. 11 PM → 7 AM) Naive subtraction returns a negative duration Toggle cross-midnight or supply dates; wraps +24 h
Spring forward — March 8, 2026, 2:00 AM Local time jumps to 3:00 AM; 2:30 AM never happens With dates enabled, computes elapsed UTC and reports 11 h for a 9 PM → 9 AM Sat-Sun shift
Fall back — November 1, 2026, 2:00 AM 1:00–2:00 AM occurs twice; ambiguous local time Same 9 PM → 9 AM shift returns 13 h
12-hour vs 24-hour confusion 12:30 PM typed as 12:30 (midday) or 00:30 (post-midnight)? Accepts both AM/PM suffix and 24-hour input; preview echoes the parsed value before computing
Working hours minus lunch Manual math: 8:30 − 0:30 = 8:00; easy to mis-tally weekly Break minutes are subtracted in the same step; weekly totals stay in decimal
Excel =(B2-A2)*24 across midnight Returns a negative decimal Match =MOD(B2-A2,1)*24 (Exceljet recipe) — works only inside 24 h; use dates for longer

Frequently Asked Questions

A shift runs 11 PM to 7 AM — why do I get a negative result without a date?

Time-only inputs assume a single calendar day. 7:00 minus 23:00 is -16 hours. Fix it one of two ways: (a) enable the cross-midnight toggle so the calculator adds 24 hours when end < start, returning 8 h; or (b) enter both dates explicitly — Mon 23:00 to Tue 07:00. Method (b) is the only correct option if the gap is longer than 24 hours, because cross-midnight only adds a single day.

How do daylight saving time changes affect the calculation?

In 2026 the U.S. springs forward on March 8 at 2:00 AM (clocks jump to 3:00 AM — the hour 2:00–2:59 AM does not exist) and falls back on November 1 at 2:00 AM (clocks roll to 1:00 AM — the hour 1:00–1:59 AM happens twice). A "9 PM Saturday to 9 AM Sunday" interval is 11 hours across the spring forward and 13 hours across the fall back, even though both look like "12 hours" on a clock. Enable dates so the calculator anchors each timestamp to a specific civil time and computes the real elapsed duration.

Can I enter times in 12-hour and 24-hour format?

Yes. 9:30 AM, 9:30 a.m., 09:30, and 9:30 (assumed AM) all parse the same. For evening times use 9:30 PM or 21:30. Mixing formats between the two inputs is fine — the calculator normalizes before subtracting. Watch out for 12:00 AM (midnight, = 00:00) versus 12:00 PM (noon, = 12:00); these are the two values people most often type backward.

What is a decimal hour and why does payroll use it?

A decimal hour is the duration written as a base-10 number instead of H:MM. Fifteen minutes is 0.25 hour, 30 minutes is 0.50 hour, 45 minutes is 0.75 hour. Payroll, legal billing, and consulting time-tracking use decimal hours because you multiply hours × rate to get dollars, and 7.75 × $80 is trivial while 7:45 × $80 is not. Most timekeeping systems (ADP, Gusto, QuickBooks Time, Clio) export in decimal hours to two or three decimal places.

How do I subtract a lunch break or other unpaid time?

Enter the total break minutes in the "Break" or "Lunch deduction" field. The result subtracts that many minutes from the gross duration. Example: 9:00 AM → 5:30 PM is 8.5 gross hours; with a 30-minute unpaid lunch the net is 8.0 hours. For multiple unpaid breaks (e.g. two 15-minute coffee breaks plus a 30-minute lunch), sum them to 60 minutes and enter that.

What if the end time is before the start time on the same day?

That depends on intent. If you meant a cross-midnight shift, enable the cross-midnight toggle so the calculator adds 24 hours. If the inputs are simply reversed, swap them. The calculator does not silently flip — it will either return a negative duration (so you notice) or wrap to the next day, depending on the toggle. This matches behavior of payroll software, which treats negative durations as input errors.

What is the Excel formula for hours between two times?

For times on the same day: =(End - Start) * 24 returns decimal hours (multiply by 24 because Excel stores time as a fraction of a day). For times that may cross midnight within 24 hours: =MOD(End - Start, 1) * 24 (Exceljet's recipe). For arbitrary date-times use =(EndDateTime - StartDateTime) * 24. Format the result cell as Number, not Time, so values like 8.5 display correctly instead of being interpreted as 8:30 AM.

How precise are the results?

The calculator works in seconds and outputs decimal hours to three decimal places (0.001 h = 3.6 seconds). For payroll, two decimals (0.01 h = 36 seconds) is industry standard. Legal billing typically rounds to the nearest tenth (0.1 h = 6 minutes). The calculator shows full precision so you can apply your own rounding rule.

Does this work for time zones?

This tool computes the duration between two civil-time stamps. If your start and end are in different time zones, convert both to a single zone first (or to UTC) before entering. For Unix epoch conversions paired with civil time, see Convert Date to Timestamp and Convert Timestamp to Date, both of which respect IANA time zones.

Does the Hours Between Calculator run offline?

Yes. All parsing and arithmetic happen in your browser using client-side JavaScript. Once the page is loaded, no further network requests are made — the calculator works without an internet connection and never sends your times to a server.

Related Calculate tools
Time Card CalculatorWorking Days CalculatorSunrise Sunset CalculatorBmi CalculatorBmr CalculatorTdee CalculatorBody Fat CalculatorCalorie Calculator

Image Tools

Image CompressorCompress JPEGCompress PNGCompress GIFCompress WebPImage ConverterJPG ConverterImage Resizer

Video Tools

Video CompressorCompress MP4MP4 to GIFVideo to GIFVideo ConverterMP4 ConverterVideo Cutter

Audio Tools

Audio CompressorCompress MP3Compress WAVAudio ConverterMP3 ConverterFLAC to MP3Audio Cutter

Document Tools

Compress PDFMerge Images to PDFSplit PDFPDF to JPGUnzip FilesRAR Extractor

Converters

Time Zone ConverterMeeting PlannerIST to ESTTime Zone AbbreviationsUnit ConverterLength ConverterFlow Rate Converter
© 2026 XConvert.com. All Rights Reserved.
About UsPrivacy PolicyTerms of ServiceContactHelp Us Grow