Calculate

Calculate

Updates as you type

Result

The formula

Take the absolute difference between the two calendar dates in milliseconds and divide by 86,400,000 (the length of a civil day). Leap days that fall between the dates are included automatically because both dates are interpreted on the Gregorian calendar. We also report whole weeks and an approximate year fraction using 365.25 days per year.

Days = |Date₂ − Date₁| ÷ 86,400,000

Worked example

  1. Start 1 January 2026, end 1 July 2026
  2. Both dates are midnights on the Gregorian calendar; July 1 is 181 days after January 1 in a non-leap year
  3. 181 ÷ 7 = 25 weeks with 6 days remainder; 181 ÷ 365.25 ≈ 0.50 years

Result: 181 days (25 weeks · ≈ 0.50 years)

How the date difference is calculated

Date math looks simple until leap years, inclusive counting, and “business days” enter the conversation. This tool reports the exclusive civil-day gap between two dates — the number of midnights crossed from one date to the other.

Calendar days (what we count)

We count whole calendar days between the two dates, including weekends and public holidays. From Monday to Friday the result is 4 days (Tue, Wed, Thu, Fri midnights after Monday), not 5 inclusive weekdays. If your contract says “within 10 days of signing,” confirm whether the parties meant calendar days, business days, or an inclusive count.

Order does not matter: the result is always the positive span. Swapping start and end yields the same number of days.

Leap years

If 29 February falls strictly between the two dates, it adds one day to the total. Century years follow the Gregorian rule (divisible by 400). The year-fraction display uses 365.25 as a long-run average — useful for rough comparisons, not for legal day counts.

Months and “add one month”

This calculator does not convert a span into years/months/days of age-style components. Adding “one month” to a date is a separate problem: 31 January plus one month may become 28/29 February or 3 March depending on the library or contract rule. For age-style Y/M/D breakdowns from a birth date, use the age calculator.

Time zones

Inputs are calendar dates without a time of day. Cross-zone events (overnight flights, remote handoffs) can disagree by one day if each party uses a local midnight. Agree on a shared zone or use timestamps when the exact instant matters.

Interesting facts

Gregorian leap rule

Most years divisible by 4 are leap years; century years must also be divisible by 400. That is why 2000 had a February 29 and 1900 did not.

Business days are a different product

US contracts often exclude weekends and federal holidays. Banks and courts publish holiday calendars; this tool does not subtract them unless you do so manually.

Inclusive vs exclusive counting

“How many days between Monday and Friday?” can mean 4 gaps or 5 named days. Always match the wording in your policy or statute.

ISO week dates

Some industries number weeks with ISO 8601 week dates (week starting Monday). Our week count is simply total days ÷ 7, not an ISO week-number difference.

Unix time still has leap seconds

Civil day counts for forms ignore leap seconds. Scientific timelines that need exact SI seconds use different time scales (UTC with leap seconds, or TAI).

Frequently asked questions

Enter both dates. The calculator returns the absolute number of calendar days between them, plus whole weeks and an approximate year fraction.

Yes. Every calendar day in the span is counted. For business-day deadlines, subtract weekends and holidays separately using your jurisdiction’s calendar.

No. The result is the positive difference, so either date can be entered first.

If February 29 lies between the dates, it adds one day. The year estimate uses 365.25 days; the day count itself is exact for the Gregorian calendar dates you enter.

This page focuses on total days and weeks. For a years/months/days breakdown from a birth date to today, use the age calculator.

Only dates are used. Two events on the same calendar date are 0 days apart here even if they were 23 hours apart by the clock.

References

  1. ISO 8601 — Date and time format — International Organization for Standardization Defines calendar date representation and related week-date conventions.
  2. Time FAQs (leap years) — National Institute of Standards and Technology (NIST) Gregorian leap-year rules used in civil calendars.
  3. Federal holidays — U.S. Office of Personnel Management Reference when converting calendar-day spans to US federal business days.