Calculate the Difference Between Two Dates

Choose two calendar dates to see the exact interval, total days, and whole weeks with remaining days.

The earlier date in the period.
Choose a date or use today.
Quick examples:

Date Difference

No result yet
Enter two dates and press Calculate

Formula: total days = UTC end date − UTC start date

Your dates are processed in your browser and are not submitted by this calculator. For legal or contractual deadlines, confirm the required counting method.

How to Use the Date Difference Calculator

Enter a start date and an end date, choose whether the end date should be included, and select Calculate. The result shows the calendar difference in complete years, complete months and remaining days. It also shows total calendar days, whole weeks with remaining days, and total hours.

  1. Select the earlier date in the Start Date field.
  2. Select the later date, or use Use Today as End Date.
  3. Enable Include the end date when both selected dates should count.
  4. Select Calculate and review the result and calculation steps.

If the dates are entered in reverse order, the default setting swaps them and tells you what happened. Turn that option off if you prefer an error instead.

How the Difference Between Two Dates Is Calculated

The difference between two dates is the elapsed calendar time from the start date to the end date. It can be expressed as one total number of days or as complete years, complete months and remaining days. These formats are calculated separately because calendar months contain 28, 29, 30 or 31 days.

Total days (exclusive):
Total days = (UTC end date − UTC start date) ÷ 86,400,000

Total days (inclusive):
Inclusive total = exclusive total + 1 day

Whole weeks:
Weeks = floor(total days ÷ 7), with the remainder shown as days

Calendar breakdown:
Count complete years first, then complete months from that anchor date, and finally count the remaining days.

Inclusive vs. Exclusive Date Counting

MethodWhat it countsSame-date resultTypical use
ExclusiveElapsed time between the dates0 daysDuration and overnight periods
InclusiveThe end date as an additional counted day1 dayAttendance, travel days and date lists

Neither method is universally correct. The right choice depends on what is being counted. Contractual and legal deadlines can use jurisdiction-specific rules, so verify those requirements separately.

Worked Date Difference Examples

Example 1: July 4 to July 26

The exclusive difference is 22 days, which equals 3 weeks and 1 day. When July 26 is included, one day is added, producing an inclusive total of 23 days.

Example 2: February 28 to March 1 in a Leap Year

In 2024, February contains 29 days. February 28 to February 29 is one elapsed day, and February 29 to March 1 is another. The exclusive difference is therefore 2 days. In a non-leap year, February 28 to March 1 is one day.

Example 3: January 31 to March 1

This range demonstrates why fixed 30-day months should not be used. The calculator works with real calendar dates, so it can return a valid calendar breakdown and total-day count without producing a negative remaining-day value.

Common Date Calculation Mistakes

  • Unclear endpoint counting: counting the end date without saying the result is inclusive.
  • Assuming 30-day months: calendar months vary from 28 to 31 days.
  • Using averages for calendar results: dividing total days by 30 does not produce an exact calendar-month breakdown.
  • Missing leap day: a range that crosses February 29 contains an extra calendar day.
  • Confusing calendar and business days: this calculator includes every day of the week; it does not exclude weekends or holidays.
  • Using local date-time subtraction: time zones and daylight-saving changes can cause off-by-one errors in date-only tools.

How to Verify the Result

Add the displayed calendar interval back to the start date: add the complete years, then the complete months, then the remaining days. The resulting anchor date should match the end date. Total days are verified separately by counting UTC date boundaries and adding one only when inclusive counting is selected.

Calendar Days and Business Days

This tool calculates calendar days, including Saturdays and Sundays. Business-day calculations depend on weekend rules and location-specific public holidays, so they should be handled separately. For an upcoming event, use the Countdown Calculator; for age-specific results, use the Age Calculator; and when hours and minutes are involved, use the Time Duration Calculator.

Frequently Asked Questions

By default, it measures elapsed time and excludes the end date. Enable “Include the end date” when that date itself must count. Identical dates return 0 days exclusively and 1 day inclusively.

Total days are one continuous count. The calendar breakdown uses complete calendar years and months, whose lengths vary, followed by remaining days. A fixed conversion cannot always make both formats look identical.

The calculator uses actual Gregorian calendar dates. When a range crosses February 29 in a leap year, that day is included automatically in the total-day calculation.

Automatic swapping is enabled by default. The calculator switches the dates and displays a notice. If you disable that option, it asks you to correct the order.

No. It counts calendar days. Business days require separate weekend and holiday rules that vary by location.

No. Calendar months contain 28, 29, 30 or 31 days. This is why the calendar breakdown uses real dates instead of an average month length.

Calculation Methodology

This calculator uses date-only UTC values for total days and real calendar anchors for complete years, months and remaining days. This avoids local time-zone and daylight-saving drift. Method and edge cases reviewed July 19, 2026.

Need another date calculation? Calculate your exact age, create a countdown to an event, or calculate a time duration using the related tools above.