Math & Utility 6 min read ·

How to Calculate Days Between Dates — Date Math Explained

Whether you're planning a trip, tracking a project deadline, or counting down to a wedding, knowing the exact number of days between two dates is surprisingly useful — and surprisingly easy to get wrong without the right tools.

The Basic Formula

The simplest way to calculate days between dates:

Days = End Date − Start Date

In practice, this means converting both dates to a numeric representation (like a Unix timestamp or Julian Day Number) and dividing the difference by 86,400 seconds (or 1 day in milliseconds).

Most people don't need to do this manually — a calculator does it instantly. But knowing the logic helps you understand what counts and what doesn't.

Include or Exclude the Endpoints?

This is the most common source of confusion. Should you count the start date, the end date, both, or neither?

Method Jan 1 to Jan 5 Best for
Exclude start, include end (default)4 daysCountdowns, deadlines
Include both endpoints5 daysEvent duration, hospital stays
Exclude both endpoints3 daysDays strictly between dates

Our days calculator defaults to "exclude start, include end" — the most common use case for countdowns and deadlines. You can toggle to include both endpoints.

Counting Business Days

Business days (weekdays only, Mon–Fri) matter for contracts, shipping estimates, and project timelines. The rough formula:

Weekdays ≈ Total Days × (5/7)

But this approximation can be off by 1–2 days depending on which day of the week the dates fall. An exact weekday count loops through each calendar day and checks if it's Saturday or Sunday — which is what our calculator does automatically.

Important: Business day calculators typically don't account for public holidays, which vary by country, state, and company. For legal contracts, always verify which holidays apply in your jurisdiction.

Weeks, Months, and Years

Once you have the raw day count, converting to other units is straightforward:

Note that "months" is inherently fuzzy — a month can be 28, 29, 30, or 31 days. For exact month counts, count calendar months directly (e.g., March 15 to June 15 = exactly 3 months).

Practical Use Cases

Leap Years and Edge Cases

Leap years add one extra day (February 29) every 4 years — with century exceptions. This matters for long-range date calculations:

For spans of 1–2 years, this rarely matters. For spans of 10+ years, you might be off by 2–3 days if you use 365 per year instead of 365.25.

Key Takeaways

Related Articles