AIBOX

Date Difference Calculator

The gap between two dates in years, months and days — plus the total in days, weeks and working days. Leap years, month-end dates and reversed dates are handled, and nothing you type leaves your browser.

Difference

Total days
Total weeks
Working days (start date not counted)
Working days including the start date
Weekend days inside the range
Holidays inside the range
Days if you count both ends

Nothing you type here is sent to us — the whole calculation runs in your browser. See our privacy policy.

How to use it

  1. Enter the two dates. Any two calendar dates work, in either order. A quick range button fills the end date in for the common cases — to the end of this month, the end of this year, or the same day next year.
  2. Read the difference in years, months and days first. That is the answer people usually want, and it is the one that matches how a contract or a rental period is counted.
  3. Then use the totals for the rest. Total days for a precise gap, weeks for scheduling, and working days when the answer should exclude weekends. If the weekend count matters, paste your holiday dates in and they are skipped too.

What "the difference between two dates" actually means

There are two defensible answers to the simplest possible date question, and they differ by one day. From 1 January to 2 January is a gap of 1 day — one day has elapsed. It is also a span of 2 days if you count both the day you start and the day you finish.

Both are used, often in the same conversation: a hotel booking runs from Friday to Sunday and is described as two nights, while "how many days until the deadline" counts elapsed days. Getting this wrong is the single most common source of off-by-one date errors, so this calculator shows both rather than picking one silently:

  • Total days — elapsed days, start date excluded. This is end − start.
  • Days if you count both endsend − start + 1, the length of the span.

The years, months and days figure uses elapsed time as well, so a rental from 15 March to 15 April is one month, not one month and one day.

Why months and years cannot be calculated by division

Days are easy: they are a fixed length. Months are not. A month is 28, 29, 30 or 31 days depending on which month it is and whether the year is a leap year, so the usual shortcuts fail in ways that look plausible.

This calculator counts whole months by matching the day of the month, in this order:

  1. Add as many whole years as fit without going past the end date.
  2. Then add as many whole months as fit.
  3. Whatever is left over is the number of days.

When the matching date does not exist in the target month — 31 February, for example — the date is clamped to the last day of that month instead of spilling into the next one. That single rule explains the answers that surprise people:

RangeResultWhy
31 January → 28 February 20261 month28 February is the clamp for 31 February.
31 January → 1 March 20261 month 1 dayOne month lands on 28 February; one more day is 1 March.
31 March → 30 April 20261 month30 April is the clamp for 31 April.
1 January → 31 December 202611 months 30 daysNot 12 months: the year does not complete until 1 January.

If you need the number of calendar months between two dates rather than the elapsed period, count the month boundaries you cross — the calculator deliberately does not guess which of the two you want.

Leap years, and the century exception

February has 29 days in a leap year. The full rule is that a year is a leap year if it is divisible by 4, unless it is a century year that is not divisible by 400. So 2024 and 2028 have a 29 February, 2100 will not, and 2000 did.

The visible consequence is that the same pair of dates can be a day apart or two days apart:

  • 28 February 2027 → 1 March 2027 is 1 day, because there is no 29 February in 2027.
  • 28 February 2028 → 1 March 2028 is 2 days, because 2028 is a leap year.

Anything that counts days by adding a fixed number per year drifts by a day every four years — which is exactly what happens to people who divide a long gap by 365.

Total days, weeks and working days

Three totals come out of the same range, and each is defined differently on purpose:

  • Weeksfloor(total days ÷ 7), with the leftover days shown separately. A gap of 30 days is 4 weeks and 2 days, not 4.3 weeks.
  • Working days — every day in the range that is not a Saturday or a Sunday and is not one of the dates you listed. Weekends and holidays are counted separately so the three figures add up to the total: weekends + holidays + working days = total days.
  • Days if you count both ends — the inclusive length, which is what you want for "how many days am I away" rather than "how long is the gap".

One detail people trip over: a holiday that falls on a Saturday or Sunday is reported separately, because it does not remove a working day. If you list 26 December and it lands on a Saturday, your working day count is unchanged — the calculator says so rather than quietly dropping the date.

Dates entered the wrong way round

An end date earlier than the start date is not an error; it is a different question. "How long ago was that?" is asked constantly, and the honest answer is the same gap measured backwards. Rather than refuse, the calculator measures the interval and labels the direction.

So if you swap the two dates, the years, months, days, total days and working days stay identical, and the note underneath tells you which way round you entered them. Nothing is silently flipped into a positive number you might misread as future time.

Why there is no holiday calendar built in

Because a built-in list would be wrong for most visitors. Public holidays differ by country and region, are set by different levels of government, are amended most years, and are frequently moved or substituted with working days elsewhere in the same week. A stale table produces a confident, wrong working day count.

Paste the dates that apply to you instead — from your contract, your staff handbook or your government's published list. One date per line, or separated by commas; anything that is not a date is ignored and reported rather than silently swallowed. If you use the same set repeatedly, save them in a note and paste them again.

Common questions

Do I count the start date when working out the difference between two dates?
Normally no. The difference between 1 March and 8 March is 7 days, because days are counted from midnight to midnight and the start date is not one of the days that elapses. That is why a one-week holiday starting and ending on a Monday covers seven nights, not eight days. If you need the count that includes both ends — how many days you are away, rather than how long the gap is — add one, or read the inclusive figure the calculator also shows.
Why can I not divide the number of days by 30 to get the months?
Because months are not 30 days. They run from 28 to 31 days, and February changes length in a leap year. Dividing 60 days by 30 happens to give a plausible answer, but 31 January plus one month is 28 February, not 2 March, and 1 March minus one month is 1 February, not 31 January. The calculator counts whole months by matching the day of the month, so the result matches how people and contracts actually count.
How does it handle leap years?
February has 29 days in any year divisible by 4, except century years that are not divisible by 400 — so 2024 and 2028 have a 29 February, 1900 does not, and 2000 does. The difference between 28 February and 1 March is therefore one day in 2027 and two days in 2028. The calculator applies the full rule, including the century exception.
What happens if I enter the end date before the start date?
You get the same numbers, with the direction noted. Entering 2 October as the start and 18 September as the end is a legitimate question — "how far back was that?" — so the calculator does not treat it as an error. It measures the gap between the two dates and tells you which way round they are.
Why is 31 January to 1 March one month and one day?
Because one month from 31 January is 28 February (or 29 February in a leap year): there is no 31 February, so the date is clamped to the last day of the month rather than spilling into March. From there, one more day reaches 1 March. This clamping rule is the common convention, and it is the reason month arithmetic cannot be done by dividing by an average month length.
Does the working day count include the start date?
The main working day figure excludes it, to stay consistent with the total day count; the second figure includes it when the start date is itself a working day. Weekends are Saturday and Sunday, and any holidays you paste in are skipped as well. The three figures — weekends, holidays and working days — always add up to the total number of days, so you can check the arithmetic yourself.

Arithmetic only. This page measures the interval between two dates that you supply. It contains no holiday calendar, no working-day assumptions beyond Saturday and Sunday, and no country data of any kind.