How to Count the Days Between Two Dates

Counts how many days lie between two dates, both excluding one end and counting both ends. The order of the two dates does not matter.

This tool counts how many days separate two dates: the length of a contract, the wait until a trip, the days served in a post.

D=n2n1D = n_2 - n_1

Here DD is the number of days, n1n_1 the day number of the start date and n2n_2 the day number of the end date. A day number counts the days elapsed from one fixed reference date. Once both dates are turned into such numbers, the uneven lengths of the months and the leap years stop mattering, and a single subtraction gives the answer.

Counting one end or both

There are two conventions. One counts a single end point, the other counts both.

From 1 January to 3 January is two days by the first convention and three by the second. Interest and rent are usually reckoned the first way, while a stay in hospital or the length of a programme is reckoned the second. The two answers always differ by exactly one day, so it is worth knowing which one the question asks for.

Worked example

With a start of 1 January 2026 and an end of 31 December 2026, the answer is 364 days, or 365 days counting both ends, which is 52 weeks.

The year 2026 is not a leap year, so it has 365 days. Subtracting one date from the other still gives 364, and only counting both ends brings the total back to 365.

Points to watch

The order of the two dates does not matter. The distance between them is the same either way, so the result is never negative.

Dates that do not exist, such as 30 February, are rejected. The 29th of February may only be entered for a leap year.