Date Difference Calculator

Free date calculator: enter a start and end date to instantly count the exact number of days, weeks, months and years between them, calendar-accurate down to leap years. It also shows the inclusive day count used for hospital stays or rental periods — where both dates count as a full day — so you never have to guess which convention applies.

What is a date difference calculator

A date difference calculator counts exactly how many days separate two dates. Counting by hand on a calendar is error-prone, because months run anywhere from 28 to 31 days and a February 29 in a leap year can throw off the count entirely — the longer the span, the less practical manual counting becomes. Just enter a start and end date and this tool instantly shows the total day count broken down four ways: years/months/days, months/days, and weeks/days.

There are also two different conventions for counting days: a plain difference that treats the start date as day zero, and an inclusive count that treats both the start and end date as a full day. Which one is correct depends entirely on the purpose — hospital stays and days worked are usually counted inclusively, while a simple elapsed-time estimate uses the plain difference, and the two answers differ by exactly one day. This tool displays both side by side, so you never need to add or subtract 1 yourself afterward. All calculation happens locally in your browser, and the dates you enter are never sent to a server.

How to calculate the difference between two dates

  1. Enter the start date Type the date you want to start counting from into "Start date." It can be in the past or the future, and spans that cross a calendar year work correctly.
  2. Enter the end date Type the date you want to count up to into "End date." To find out how many days have passed up to today, press the "Use today" button to fill it in instantly.
  3. Pick the counting mode for your purpose The result updates as you type. Use "years, months, days" to communicate a duration intuitively, or use "Total days" versus "Inclusive days" when the exact day count matters for a form or claim.
  4. Read the full breakdown Check the weeks-and-days and months-and-days rows too — they make it easier to sanity-check the result or explain it to someone else in whichever unit is most natural.

Tips for getting more out of it

  • Put an upcoming event's date in "End date" to see exactly how many days remain until it. Use the "Use today" button to instantly fill the end date with today's date.
  • The "years, months, days" breakdown is calendar-accurate, not a rough estimate — for example, January 15 to March 20 is correctly shown as "2 months, 5 days" rather than a raw day count divided by 30.
  • When calculating a contract or project timeline, set the start date to the signing date and the end date to the deadline to see both the remaining period and the total duration at a glance.
  • Periods spanning a leap year (including February 29) are handled automatically, so you never need to double-check leap-year day counts by hand.
  • If you accidentally set the end date earlier than the start date, the tool automatically swaps them and shows a note so you don't need to fix it manually.

When this tool is useful

Countdown to an event or deadline

Set the end date to a wedding, exam, product launch, or contract deadline to see exactly how many days remain, updated instantly as today's date changes.

Calculating tenure or time since a milestone

Set the start date to a hire date, relationship anniversary, or sobriety date to track exactly how many days, months, and years have elapsed since then.

Project timelines and delivery deadlines

Set the start date to a contract signing date and the end date to a delivery deadline to see both the total duration and the days remaining at a glance — useful for tracking progress as elapsed days divided by total days.

Notice periods and legal deadlines

Many contracts and statutes specify a required notice period in days (for example, 30 days' notice before termination). Enter the notice date and the effective date to confirm the exact day count required.

Pregnancy and hospital-stay day counts

Insurance claims and hospital admission forms often require an inclusive day count where both the admission and discharge dates count as full days — the "Inclusive days" row gives you that figure directly.

Terms related to date calculations

Inclusive days
A day count that treats both the start date and the end date as a full day — equal to the plain difference plus one. Used whenever you need to count every day a condition applied, such as a hospital stay, a rental period, or days worked.
Exclusive (plain) difference
A day count that treats the start date as day zero, counting only the gap between the two dates. This is the default meaning of "how many days between X and Y" in most everyday and legal contexts.
Anniversary day
When counting in months or years, the date that shares the same day-of-month as the starting date. For example, one month after January 31 lands on the last day of February, since February has no 31st — this tool's years/months/days breakdown handles that borrowing automatically.
Leap year
A year in which February has 29 days. A year divisible by 4 is a leap year, except that a year divisible by 100 is not, unless it is also divisible by 400. The year 2000 was a leap year, but 1900 and 2100 are not.
Gregorian calendar
The solar calendar introduced in 1582 by Pope Gregory XIII and now used almost worldwide. Its leap-year exception rules keep the calendar year closely aligned with Earth's actual orbital period.
Business day
A day on which normal business is conducted, excluding weekends, public holidays, and year-end closures. Banking transfers and delivery estimates are usually counted in business days rather than calendar days, which is why a separate business day calculator exists.

Frequently asked questions

The Age Calculator is specifically built to compute a person's current age from their birthdate. This tool is a general-purpose date-interval calculator where you can freely choose any start and end date, letting you measure any span of time — a countdown to an event, a project duration, and more — not just age.

The Time Calculator adds or subtracts hours, minutes and seconds within a single day (for example, adding 2 hours 15 minutes to 9:30). This tool instead measures the calendar interval between two dates in years, months, weeks and days. Use the Time Calculator if you need sub-day precision.

It won't produce an error. The tool automatically swaps the two dates internally, calculates the interval as an absolute value, and displays a note explaining that the dates were swapped, so you can use it confidently even if you're unsure which date comes first.

Yes. Periods that include February 29 are calculated correctly for days, months and years thanks to JavaScript's native date arithmetic. There's no need to manually check whether a leap year is involved.

"Total days" is the plain difference between the start and end date (the start date counts as day zero). "Inclusive days" adds 1 to that, counting both the start and end date as a full day — the convention used for hospital stays, rental periods, and tenure calculations. Neither is more "correct" than the other; use whichever matches your purpose.
Tool-kun

Side Note — the surprising pitfalls of counting days by hand

When people estimate the gap between two dates by hand, they often round a month to a flat 30 days. But real months range from 28 to 31 days, so estimating January 15 to March 20 as "64 days ÷ 30 ≈ 2.1 months" can drift from the calendar-accurate answer of "2 months and 5 days" — a difference that matters when it determines a contract deadline or an invoice due date. This tool instead compares year, month and day fields directly on Date objects, so it always returns a calendar-accurate breakdown.

Leap years aren't simply "every four years." Under the Gregorian calendar's leap year rule, a year divisible by 4 is a leap year, except that years divisible by 100 are not, unless they're also divisible by 400. The year 2000 was a leap year, but 1900 and 2100 are not. This exception is built into standard JavaScript date handling, and this tool relies on that same behavior.

There are two common conventions for counting elapsed days: an inclusive count that treats the start date as day one (so January 1 to January 10 is "10 days"), and a plain difference that only counts the gap ("9 days"). Which one you need depends on the purpose — hospital stays and rental periods typically use the inclusive count, while a simple elapsed-time estimate uses the plain difference. This tool shows both at once, so you don't have to convert between them yourself.