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
- 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.
- 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.
- 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.
- 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
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.