Date Difference
Calculate days, weeks, and business days between any two dates.
Quick shortcuts
☕ This tool is free forever. If it saved you time, buy me a coffee.
- Verified: results checked against independent formulas on every release
- Last reviewed:
- Runs in your browser: nothing is uploaded
- Found an error?
How this is calculated
The calculator counts the calendar days between two dates, and also breaks the gap into years, months and days.
Formulas
Days are whole elapsed days between the two dates. Neither end date is added to the count.
days = (end date − start date) in days
A year is a leap year when it divides by 4, except century years, which must also divide by 400. February then has 29 days instead of 28.
leap = year % 4 = 0 and (year % 100 ≠ 0 or year % 400 = 0)
For years, months and days it adds whole months to the start date. When the start day does not exist in a month (31 January plus one month), the date clamps to that month's last day.
Sources
- IETF RFC 3339, Date and Time on the Internet: Timestamps. Defines leap years in the Gregorian calendar and gives the divisible-by-4, 100 and 400 rule in code.
How we test this
This tool is checked against independent formulas every time the site is released, and a release does not ship if a check fails. Example from the test suite: 31 January 2023 to 28 February 2023 gives 1 month, 0 days. The test also checks that 1 January 2024 to 1 January 2025 is 366 days and the reverse order gives a negative count.
The test is “date-difference: month-end clamping: 31 January to 28 February is one month” in tests/golden-calculators.test.mjs. More on how all tools are tested: our testing approach.
Assumptions and limits
- Calendar dates only, with no time of day, time zone or daylight saving.
- Month-and-day breakdowns depend on the start date; the day count does not.
Last reviewed , the date of the latest change to this tool's calculation or content.
Navigation
When to use this
Your lease ends on August 14 and you need to know exactly how many days you have to find a new place. A contract specifies "delivery within 90 business days" and you need to pin down the actual calendar date. You're planning a trip and want to know if 17 days is enough to do everything you have in mind. Date math sounds trivial until you try to account for months with different lengths, leap years, and weekends.
Project managers use this constantly — estimating sprints, calculating buffer time, and converting between calendar days and business days. HR departments need it for probation periods, benefits eligibility dates, and FMLA calculations. Real estate closings, legal filing deadlines, and insurance waiting periods all hinge on precise day counts.
It's also the quick answer to casual questions: how many days until Christmas, how long until summer break, or how many weekends are left before a deadline. The business-day count is especially useful because manually counting while skipping Saturdays and Sundays is tedious and error-prone.
Good to know
Business days and calendar days diverge fast. A 30-calendar-day window contains only about 22 business days. Over 90 calendar days, you lose roughly 26 days to weekends. If a deadline is in "business days," always convert to calendar days so you don't underestimate the timeline.
This calculator does not account for public holidays. Business days here means weekdays (Monday–Friday). Federal holidays, state holidays, and company-specific closures aren't subtracted because they vary by location and employer. For precise SLA or legal deadline calculations, subtract holidays manually from the business day count.
"Inclusive" vs. "exclusive" counting matters. If an event starts on January 1 and ends on January 31, is that 30 days or 31? It depends on whether you count the start date. This calculator uses exclusive counting (the standard for durations) — January 1 to January 31 = 30 days. Legal and medical contexts sometimes use inclusive counting, so verify which convention applies.
Months are not equal units. "Three months from January 31" could be April 30 or May 1 depending on interpretation, because February has fewer days. This calculator handles month math by adjusting to the last valid day of the target month when needed.
Quick Reference
| Duration | Calendar Days | Business Days (approx.) |
|---|---|---|
| 1 week | 7 | 5 |
| 2 weeks | 14 | 10 |
| 1 month | 28–31 | 20–23 |
| 90 days | 90 | ~64 |
| 6 months | 181–184 | ~130 |
| 1 year | 365 (366 leap) | ~261 |
| Common notice period | 30 days | ~22 |
| Typical probation | 90 days | ~64 |