Time & dates

Date difference calculator

Enter a start date and an end date to measure the gap between them in days, weeks, months and years.

Count the end date when both the first and the last day should be included, as in a hotel stay versus a rental period.

How the difference between two dates is calculated

The day count is simply the later date minus the earlier one, measured in whole calendar days: days = end date − start date. This treats the start day as day zero, the convention used in spreadsheets (=B1−A1) and most programming languages. If you choose to count the end date, one day is added, which is right when both the first and last days are part of the period, for instance the days of a festival or a leave request from Monday to Friday (5 days, not 4).

Calendar months are counted by stepping forward from the start date one month at a time without passing the end date, then counting the days left over. When the start day does not exist in a shorter month (31 January plus one month), the last day of that month is used. Example: from 22 October 2026 to 20 January 2027 there are 90 days. That is 12 weeks and 6 days; stepping by month reaches 22 December after 2 months, and 29 more days lead to 20 January, so 2 months 29 days, or about 0.25 years.

FromToDaysWith end dateMonths + days
1 Jan 20261 Feb 202631321 + 0
1 Jan 20261 Mar 202659602 + 0
1 Jan 20281 Mar 202860612 + 0
15 Mar 20264 Jul 20261111123 + 19
1 Jan 20261 Jan 202736536612 + 0

Choosing the right counting rule

Most disagreements about date gaps come from the inclusive question. A hotel stay from the 10th to the 14th is 4 nights, so leave the end date out; a course running from the 10th to the 14th covers 5 days, so count it. Contracts and legal deadlines often define their own rule, so read the wording before relying on either number.

Months are not a fixed length, which is why the month figure is given as months plus days instead of a decimal. The years line divides by 365.2425, the mean length of a Gregorian calendar year including leap years, so it is a smooth average rather than a count of birthdays. Leap days are handled automatically: the gap from January to March is one day longer in 2028 than in 2026, as the table shows. To measure working days only, subtract weekends and public holidays, which this tool does not do.

Frequently asked questions

How do I calculate the number of days between two dates?

Subtract the earlier date from the later one in calendar days. In a spreadsheet, put the dates in two cells and use =B1-A1. Add 1 if both the first and last days should count.

Should I include the end date when counting days?

Include it when every day in the range counts, like days of annual leave or an event. Leave it out for durations such as nights in a hotel, loan days or age in days.

How many days are there between two dates a year apart?

365 days, or 366 if the span includes 29 February of a leap year, such as 1 January 2028 to 1 January 2029.