---
title: "Time Difference Calculator"
description: "Work out how long there is between two times of day, including a shift that runs past midnight. Subtract an unpaid break and read the answer in hours and minutes or as decimal hours. Runs in your browser."
url: https://findutils.com/calculate/time-difference-calculator/
category: calculate
---

# Time Difference Calculator

Work out how long there is between two times of day, including a shift that runs past midnight. Subtract an unpaid break and read the answer in hours and minutes or as decimal hours. Runs in your browser.

**Use this tool:** [Time Difference Calculator](https://findutils.com/calculate/time-difference-calculator/)

## Programmatic access

- REST id `time-difference`: POST https://api.findutils.com/api/tools/time-difference/execute (reference: https://findutils.com/api/time-difference/)
- MCP tool `time_difference` on https://mcp.findutils.com (reference: https://findutils.com/mcp/time-difference/)

## Why Use Our Time Difference Calculator?

Working out that 09:00 to 17:30 is eight and a half hours takes a second. Working out that 22:00 to 06:00 is eight hours takes longer than it should, because the end is a smaller number than the start and the obvious subtraction gives minus sixteen. That is the case this page exists for. It wraps past midnight, subtracts an unpaid break, and gives the answer both as hours and minutes and as decimal hours, which is the form a timesheet or an invoice actually wants.

## Frequently Asked Questions

### How do I calculate hours across midnight?

Enter the times as they are and leave Past midnight on Auto. When the end is not after the start, a day is added, so 22:00 to 06:00 comes out as eight hours rather than minus sixteen.

### What does 09:00 to 09:00 give?

Twenty-four hours. Two equal times mean a full day, not zero — returning zero would quietly drop a day from a timesheet.

### What are decimal hours?

The duration as a single number for payroll and invoicing. Eight hours and thirty minutes is 8.5 decimal hours, not 8.3, which is a common and expensive slip.

### Can I subtract a lunch break?

Yes. Put the unpaid minutes in the Break field and they come off the total. A break longer than the shift is rejected rather than giving a negative answer.

### Does it accept am and pm?

Yes, alongside 24-hour times. 12:00 am is treated as midnight and 12:00 pm as noon, which is the pair most calculators get wrong.

### What is the difference between Auto, Always and Never?

Auto wraps past midnight only when the end is not after the start. Always treats the end as the next day regardless, so 09:00 to 17:00 becomes 32 hours. Never refuses to wrap and reports that the times look reversed.

### What if my two times are on different dates?

Use the Date Difference Calculator instead. It takes full date and time values and returns the gap in years, months, days, hours, minutes and seconds.

### Is my input sent anywhere?

No. The calculation runs in your browser and nothing is uploaded.

### Can it handle seconds?

Yes. Enter times as HH:MM:SS and the seconds are counted and shown.

### Can I use this from a script or an AI client?

Yes. The same calculation is available over HTTP and to MCP clients, so an agent can work out a shift length without opening this page.

## Related Tools

- [Date Difference Calculator](https://findutils.com/calculate/date-difference-calculator/)
- [Timesheet Calculator](https://findutils.com/finance/timesheet-calculator/)
- [Age Calculator](https://findutils.com/calculate/age-calculator/)
- [Timezone Converter](https://findutils.com/productivity/timezone-converter/)
- [Unix Timestamp](https://findutils.com/developers/unix-timestamp/)
- [Countdown Timer](https://findutils.com/productivity/countdown-timer/)
- [Stopwatch](https://findutils.com/productivity/stopwatch/)
- [Work Anniversary Calculator](https://findutils.com/calculate/work-anniversary-calculator/)
- [ICS to CSV](https://findutils.com/convert/ics-to-csv/)
- [CSV to ICS](https://findutils.com/convert/csv-to-ics/)
