Date Difference Calculator

Pick two dates to see exactly how far apart they are: as years, months and days, and as total days, weeks and hours. The calculation uses the real calendar, including leap years and months of different lengths, and you can choose to count the end date too. Everything runs in your browser.

Processed locally in your browser. Your data is not uploaded to our servers.

Choose a date or type it as year-month-day.

Adds one day, as when counting both the first and the last day of a stay or a deadline.

Result

Examples

Worked examples:

FromToDifferenceTotal days
2020-01-012020-03-012 months60
2021-01-312021-03-011 month, 1 day29
2000-02-292026-09-2926 years, 7 months9,709
2023-12-312024-01-011 day1

Formula & Methodology

Every date becomes a day number, so the total number of days is an exact subtraction. For years, months and days, whole calendar months are counted from the earlier date, and the days are what remains. When the earlier day does not exist in a later month, the last day of that month is used: 31 January plus one month is 28 February (29 in a leap year).

Notes and limitations

  • Dates are plain calendar dates with no time zone or time of day. Hours are simply days ร— 24, and daylight-saving changes are not applied.
  • The calendar is the Gregorian calendar extended backwards. Dates before its introduction in 1582 are not adjusted for older calendars.
  • Counting the end date adds one day to every figure.
  • Month lengths vary, so โ€œ1 monthโ€ is not always the same number of days.
  • Supported dates run from year 1 to year 9999.

How to Use

  1. Choose the start date and the end date.
  2. Tick โ€œCount the end date tooโ€ if the last day should be included.
  3. Read the difference in years, months and days and the totals.
  4. Use the swap button to compare in the other direction.

Frequently Asked Questions

How many days are there between two dates?

Subtract one date from the other. The calculator does this exactly with the real calendar, so leap days are included. From 1 January 2020 to 1 March 2020 there are 60 days.

Should I count the end date?

Counting only the days that pass gives the plain difference. If both the first and the last day count (for example a hotel stay or a deadline that includes the final day), tick the option to add one day.

How are months counted when the days do not match?

Whole months are counted from the earlier date. If a month is too short for the start day, the monthโ€™s last day is used: 31 January plus one month is 28 February, so 31 January to 1 March is 1 month and 1 day.

Does it handle leap years?

Yes. 29 February exists only in leap years, and the totals of days are exact for any range from year 1 to 9999.

Is anything sent to a server?

No. The calculation runs in your browser and nothing you enter is uploaded or sent to analytics.

Last updated: