How many days between March 5 and October 12? The question sounds simple enough for mental math until you actually try it. Months have different lengths. Leap years show up every four years (mostly). And "from Monday to Wednesday" can mean 2 days or 3 depending on whether you count the starting day. Here is how to calculate the number of days between two dates reliably — every time.

The definition matters before the math

First, decide whether you are counting inclusive or exclusive.

  • Exclusive counts the gap between the two dates. March 1 to March 3 = 2 days (the 1st is "day zero"). This is what most calculators do by default.
  • Inclusive counts both endpoints. March 1 to March 3 = 3 days (the 1st, 2nd, and 3rd).

For legal documents, warranty periods, and contract deadlines, the rules vary — always check which convention applies. For date-age math, exclusive is standard.

The simple case: same month

If both dates are in the same month and year, subtract the day numbers. May 4 to May 18 = 18 − 4 = 14 days (exclusive).

The general method: ordinal day of year

For any two dates in the same year, convert each to its "day of the year" and subtract. January 1 is day 1. December 31 is day 365 (or 366 in a leap year).

Example: March 10 to July 22 in a non-leap year.

  • March 10 → Jan (31) + Feb (28) + 10 = day 69
  • July 22 → Jan (31) + Feb (28) + Mar (31) + Apr (30) + May (31) + Jun (30) + 22 = day 203
  • Difference: 203 − 69 = 134 days

Across years: watch for leap years

For dates in different years, you have to account for each full year and the partial starts and ends. A common approach:

  1. Count the days from the start date to the end of its year.
  2. Add 365 (or 366) for each complete year in between.
  3. Add the day-of-year for the end date.

Example: June 15, 2023 to February 20, 2026.

  • June 15, 2023 to Dec 31, 2023: 365 − 166 = 199 days (June 15 is day 166)
  • Full 2024 (leap year): 366 days
  • Full 2025: 365 days
  • Jan 1, 2026 to Feb 20, 2026: 51 days
  • Total: 199 + 366 + 365 + 51 = 981 days

The leap year rule

A year is a leap year if:

  • Divisible by 4, AND
  • NOT divisible by 100, UNLESS
  • ALSO divisible by 400

So 2024 is a leap year (÷4 yes, ÷100 no). 1900 was not (÷100 yes, ÷400 no). 2000 was (÷400 yes). This rule exists because Earth's orbit is about 365.2422 days — the correction keeps calendars aligned with seasons over centuries.

The mental math shortcut: 30-day months

For rough estimates, pretend every month has 30 days. Month difference × 30 + day difference. From March 10 to July 22: 4 months × 30 + 12 days = 132 days. The true answer is 134 — close enough for most quick estimates.

Business days vs calendar days

"Ship within 5 business days" means 5 days that are not weekends or holidays. A 5-business-day window starting Monday ends Friday (5 calendar days). Starting Thursday, it ends the following Wednesday (7 calendar days). Our working days calculator handles this distinction — a standalone article covers the details.

Common mistakes

Forgetting leap years. Between Feb 1, 2023 and Feb 1, 2024, there are 365 days — but if either date is Feb 29, 2024 or later and the other is before, you must include the leap day.

Counting days instead of nights. A 3-night hotel stay checking in on the 1st checks out on the 4th — 3 nights, 4 calendar days involved. Travel itineraries often confuse these.

Time zone shifts. Flights that cross time zones can appear to add or lose a day. Always use the local dates at each end, not UTC math.

Why this matters

Days-between calculations drive countless real-world applications: loan interest accrual, lease and rental durations, pregnancy tracking, project scheduling, contract notice periods, age verification, and much more. An error of one day in a high-stakes calculation — a medication interval, a legal deadline — can have real consequences.

Get the answer instantly

For routine work, skip the mental math and use our date difference calculator. It handles leap years, inclusive/exclusive counting, and cross-year spans correctly every time. Enter a start date, an end date, and get the exact number of days, weeks, months, and years between them. When precision matters, a tool beats manual counting every time.