AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I calculate the exact number of days between two dates?

Enter a start date and an end date into AnyTool Date Difference Calculator and it instantly shows the exact duration in years, months and days, calculated on the Gregorian calendar with real month lengths and leap years. It also gives the same span as total days, weeks, months, hours and minutes, the number of business (Monday–Friday) days, and the weekday each date falls on. You can include or exclude the end date and add your own holidays to subtract from the business-day count, and everything is computed in your browser so your dates are never uploaded.

  • Exact difference in years, months and days (leap-year correct)
  • Totals: days, weeks, months, hours and minutes
  • Business (weekday) days, with custom holidays excluded
  • Include-or-exclude the end date, and reversed dates are swapped
  • 100% in your browser — no upload, no signup, works offline

What is

Date difference

A date difference is the elapsed time between two calendar dates. It is commonly expressed two ways: as calendar time — completed years, then completed months, then the remaining days — and as a single total such as the number of days, weeks or hours. On the Gregorian calendar the calendar-time form requires borrowing across the differing lengths of months (28–31 days) and across leap years, which is why a simple subtraction is not enough. A related count, business or working days, includes only Monday to Friday and excludes weekends and any public holidays.

Calculators

Related terms

Gregorian calendarBusiness daysLeap yearInclude end date

Frequently Asked Questions

Subtract the earlier date from the later one to get the number of nights between them; tick "include end date" to count the final day too.

The number of days between two dates is the count of nights from the start date to the end date, so by default the start day counts and the end day does not. AnyTool Date Difference Calculator shows that total live as you type, and an "include end date" toggle adds the final day to every day-based total. It also converts the same span into total weeks, months, hours and minutes, and shows the exact years/months/days breakdown.

Yes — it counts Monday to Friday only, lists the weekend days separately, and removes any holidays you add that land on a weekday.

Business days are weekdays, Monday through Friday. AnyTool counts how many of them fall in the span, reports the weekend days (Saturdays and Sundays) separately, and lets you add your own holiday dates; any holiday that lands on a weekday is subtracted from the business-day total. Public holidays are not built in because they differ by country, region and year, so you add the ones relevant to you.

The calculator detects the reversed order and swaps the dates, then reports the duration and notes that it swapped them.

If you enter the dates the wrong way round, AnyTool automatically swaps them so the earlier date becomes the start and the later one the end, then computes the difference normally and tells you it swapped them. If both dates are the same day the difference is simply zero days. It also shows which weekday each date falls on.

It is calendar-accurate on the Gregorian calendar and uploads nothing — every calculation runs in your browser.

The years/months/days figure uses correct month lengths and leap years, matching how reputable duration calculators report it, and all arithmetic is done in UTC to avoid daylight-saving jumps. Hours and minutes are whole days times 24 and 1440, so the exact time of day is not counted, and because the tool uses your device calendar your time zone can shift a boundary day near midnight. Your dates are never sent to a server; the page works offline after first load.

Detailed Explanation

Methodology

How the Date Difference Calculator Works

AnyTool Date Difference Calculator computes the gap between two dates in the browser using a pure, clock-free engine: the page decides what “today” is for the default end date and passes both calendar dates to the engine, which counts completed years, then completed months, then the remaining days. To make the day count correct it borrows the real length of the preceding month — 28, 29, 30 or 31 days — and accounts for leap years. The same interval is also expressed as total days, weeks, months, hours and minutes; by default the span counts the nights between the dates (start day in, end day out), and an include-end-date toggle adds the final day. All date arithmetic is done in UTC to stay immune to daylight-saving shifts.

  • Counts whole years, then months, then leftover days
  • Borrows real month lengths and leap years for accuracy
  • Also returns total days, weeks, months, hours and minutes
  • Include-end-date toggle adds the final day to day totals
  • Engine is clock-free and unit-testable — the page supplies the dates
How It Works

Business Days and Custom Holidays

Beyond calendar days, the calculator counts business (working) days — Monday to Friday only — and reports the weekend days separately, split into Saturdays and Sundays. Because public holidays vary by country, region and year, none are built in; instead users add their own holiday dates, and any holiday that lands on a weekday inside the span is subtracted from the business-day total. Reversed dates are detected and swapped, and identical dates yield a zero-day difference.

  • Business days count Monday–Friday only
  • Weekend days reported separately (Saturdays and Sundays)
  • User-added holidays on a weekday are excluded from working days
  • Reversed start/end dates are automatically swapped
  • Shows the weekday each of the two dates falls on
Limitations

Calendar, Time-Zone and Holiday Caveats

The tool is accurate on the Gregorian calendar but states its limits plainly. Hours and minutes are whole days multiplied by 24 and 1440, so the exact time of day is not included. Whether the end date counts depends on the include-end-date toggle, which changes day-based totals by one. Public holidays are not pre-loaded because they differ by jurisdiction, so the business-day figure is only as complete as the holidays the user adds. Because the difference is measured against the device’s local calendar, the time zone can change what counts as a boundary day near midnight.

  • Time of day is not counted; hours = days × 24
  • Include-end-date toggle shifts day totals by one
  • No built-in public holidays — users add their own
  • Time zone can shift a boundary day near midnight
  • Presented honestly with its assumptions stated
Privacy & Security

Privacy and Offline Use

Because every calculation runs in the browser, the two dates and any holidays you enter are never sent to a server, there is no account or tracking, and the page works offline after first load. The calculator is built on a shared, clock-free, unit-tested date engine, so its behaviour is consistent and verifiable.

Date difference: in-browser (AnyTool) vs typical online date calculators
CapabilityAnyToolTypical online calculators
ProcessingRuns in your browserOften server-side
Exact durationYears, months, days (leap-year correct)Sometimes only total days
TotalsDays, weeks, months, hours, minutesOften days only
Include end dateToggle on/offSometimes fixed
Business daysMon–Fri count with weekend splitSometimes missing
Custom holidaysAdd your own to excludeRarely supported
Reversed datesAuto-swappedSometimes errors
Works offlineYes (PWA)No
Cost / signupFree, no signupOften ad-heavy or gated

AnyTool computes the difference and every derived figure locally and uploads nothing.