Calculating the number of days between two dates seems like it should be trivial — subtract one from the other. And for the raw day count, it mostly is. But once you factor in inclusive vs. exclusive counting, leap years, and business days, small ambiguities can throw off results by a day or more — which matters a great deal in legal, financial, and medical contexts.

The basic calculation

At its core, the day difference between two dates is simply the number of complete 24-hour periods between them. If you convert both dates to a standardized numeric format (like a Julian day number, or milliseconds since a reference epoch), the difference is a straightforward subtraction.

The complexity isn't really in the subtraction — it's in the conventions around which dates you count.

Inclusive vs. exclusive counting — the most common source of off-by-one errors

Consider January 1 to January 5. How many days is that?

Which one is "correct" depends entirely on context. If you're calculating how many days until an event, exclusive counting (days remaining) is standard. If you're counting how many calendar days a hotel booking spans (check-in through check-out night), inclusive counting is typically used. Always clarify which convention applies to your specific situation — especially in legal or financial contexts where this ambiguity has real consequences.

Leap years complicate longer date ranges

A common year has 365 days; a leap year has 366. Leap years occur in any year divisible by 4 — except century years (divisible by 100), unless they're also divisible by 400.

This matters because calculating "one year from now" isn't always exactly 365 days — if the range includes February 29 of a leap year, it's 366 days. For multi-year ranges, the exact day count depends on exactly how many leap years fall within the span.

Business days vs. calendar days

Many practical situations — contract notice periods, shipping estimates, legal filing deadlines — count only business days (Monday through Friday, excluding weekends), not raw calendar days.

Calculating business days requires iterating through each day in the range and checking whether it falls on a weekend. Public holidays add another layer of complexity, since they vary by country, region, and even by industry (bank holidays differ from federal holidays, for example) — most simple calculators account for weekends but require manual adjustment for holidays specific to your location.

Worked example: calculating a deadline

Suppose a contract specifies "written notice must be given no less than 30 business days before termination," and you want to give notice today, aiming to terminate on a specific date.

  1. Start from your target termination date
  2. Count backward, skipping Saturdays and Sundays
  3. Continue until you've counted 30 valid business days
  4. That date is your notice deadline

Because weekends aren't evenly distributed relative to any starting point, 30 business days is typically somewhere between 41–43 calendar days, depending on exactly which day of the week you start counting from.

Common everyday use cases

A note on the Schengen 90/180 rule

This is a great real-world example of why precise date calculation genuinely matters. Many countries allow visa-free stays of "90 days within any 180-day period." This isn't a simple fixed window — it's a rolling calculation, meaning for any given day, you look back 180 days and count how many of those days you spent in the zone. Miscounting by even a day or two can result in visa violations, making accurate date math a real practical necessity, not just an academic exercise.

Skip the manual counting

Our Date Difference Calculator handles leap years, gives you total days/weeks/months, and includes a business-days count automatically.

Try the calculator →

Quick reference: average day counts

PeriodTypical day count
1 week7 days
1 month (average)30.44 days
1 year (non-leap)365 days
1 year (leap)366 days
1 year (average, long-term)365.25 days
30 business days~41–43 calendar days

Whatever the context, the safest approach is to be explicit about your counting convention (inclusive or exclusive), account for leap years in longer ranges, and clarify whether calendar days or business days are required — before you commit to a number that a deadline, contract, or legal filing depends on.