Why date math is trickier than it looks
Subtracting two dates seems like simple arithmetic, but calendars aren’t uniform: months range from 28 to 31 days, leap years insert an extra day roughly every four years (with exceptions — a year divisible by 100 isn’t a leap year unless it’s also divisible by 400, which is why 2000 was a leap year but 1900 wasn’t), and daylight saving time transitions mean some days genuinely have 23 or 25 hours rather than 24 in the timezone where the clocks change. Any date calculator that works by converting dates to timestamps and dividing by a fixed number of milliseconds-per-day will silently produce wrong answers across a DST transition, because the elapsed milliseconds between two calendar dates aren’t a fixed multiple of 24 hours when a clock change falls in between. This calculator works directly with calendar date components (year, month, day) rather than raw timestamps specifically to avoid that class of bug.
Inclusive vs. exclusive counting, and why it matters
“How many days between January 1 and January 3?” has two defensible answers depending on what you’re actually asking. As elapsed time (how much time has passed), the answer is 2 days — you go from the 1st to the 3rd by advancing 2 days. As an inclusive count (how many calendar days does this span touch), the answer is 3 — the 1st, 2nd, and 3rd. Both conventions are used in the real world: “a 3-day event from the 1st to the 3rd” uses inclusive counting, while “how many days until my flight” uses elapsed time. This calculator defaults to elapsed time, matching the most common interpretation of “date difference,” and labels the result clearly so there’s no ambiguity about which convention produced the number you’re looking at.
How month and year differences are calculated
Because months vary in length, “the number of months between two dates” can’t be computed by simple division. This calculator instead counts complete calendar-month boundary crossings: starting from the start date, it checks whether advancing one full calendar month (same day-of-month, next month) would still be at or before the end date, and repeats. This is the same logic used to calculate a person’s age in years — you don’t turn a year older at 365-day intervals, you turn a year older on your birthday’s calendar date regardless of whether the intervening year had a leap day. The same logic extended to months means, for example, that January 31 to February 28 in a non-leap year counts as a full month (since February doesn’t have a 31st, the month is considered to complete at its last valid day), which matches how most people intuitively think about “a month later” when the starting day-of-month doesn’t exist in the following month.
Business days: a simple, deliberately unambiguous definition
Business-day counting in this calculator means Monday through Friday, full stop — it does not attempt to exclude public holidays, because holiday calendars differ by country, region, and even individual company policy, and silently guessing wrong would be worse than being explicit about the definition used. If you need holiday-aware business-day counting for a specific jurisdiction, treat this calculator’s business-day count as the weekday baseline and manually subtract any holidays that fall within your date range.
The “add or subtract days” mode
Switching to add/subtract mode answers a different, equally common question: “what date is 45 days from now?” or “what date was it 90 days before this deadline?” This is calculated by advancing (or reversing) the given date by exactly that many calendar days — again operating on calendar date components rather than raw timestamps, so a calculation that crosses a DST transition or a leap year still lands on the correct calendar date rather than being off by an hour or a day. This mode is commonly used for calculating due dates from an invoice date, return-policy deadlines from a purchase date, or a follow-up date from today.
Sharing a calculation via URL
Every input to this calculator is reflected in the page’s URL as query parameters, so copying the link from your address bar after entering your dates preserves the exact calculation — useful for sharing a specific date-difference result with someone else, or bookmarking a recurring calculation (like a fixed deadline countdown) to revisit without re-entering the dates each time.