Everyday Free Tools

Guides/Date difference

How to calculate days between two dates

Counting days between dates shows up in project deadlines, travel planning, warranties, and event countdowns. Calendar math is trickier than it looks because months have different lengths and leap years exist.

The reliable approach

Convert each calendar date to a fixed reference (for example UTC midnight for that year-month-day), then subtract and divide by 86,400,000 milliseconds (one day). That avoids most timezone “off-by-one” bugs that happen when you use local midnight near DST changes.

Worked examples

  1. Same month: 2026-03-01 → 2026-03-31 = 30 days(end − start; the end date is not “inclusive” as a +1 unless you choose that convention).
  2. Across months: 2026-01-15 → 2026-02-15 = 31 daysin a non-leap February span from mid-Jan.
  3. Add N days: start 2026-10-31 + 30 days → 2026-11-30.
  4. Two weeks: 2026-01-01 → 2026-01-15 = 14 days = 2.00 weeks.
  5. Leap day: 2024-02-28 → 2024-03-01 = 2 days(2024 is a leap year, so Feb 29 exists).

Inclusive vs exclusive counting

If someone says “how many days does the trip last from Friday to Sunday?”, they may mean 3 calendar days (inclusive) even though Sunday − Friday = 2. Always clarify whether both endpoints count. Our calculator reports the signed day difference (end − start). For countdowns and business-day estimates, seehow many days until a date.

Common mistakes

When to use which tool

Use the free calculator

Try theDate Difference Calculatorto compare two dates or add N days. Private, client-side only.

Related:Days until a date·Unit Converter·Unit conversion guide