Skip to content
Allin

How Many Days Between Two Dates

Published 10/21/2025 · 3 min read · Everyday calculators

Lena Hoffmann

Lena HoffmannScience & education writer at Allin

Mathematics · Physics

Checked against 2 sources

View profile
In short

To count the days between two dates, subtract the earlier from the later. Within one month just subtract the day numbers; across months, add the days left in the first month, the whole months between, and the days into the last. From 10 March to 25 March is 15 days; from 20 January to 5 February is 16. Watch for leap years and whether you count both endpoints.

Subtract the earlier date from the later, minding month lengths and leap years. Here's how to count it, and whether to include both endpoints.

The basic idea

Counting days is just subtraction: the later date minus the earlier one. When both fall in the same month it's immediate — from 10 March to 25 March is simply 25 − 10 = 15 days. The only reason it ever gets fiddly is that our calendar isn't built on a tidy round base: months have different lengths and years occasionally gain a day. Handle those two wrinkles and any date difference is straightforward.

Counting across months

When the dates span more than one month, break the gap into pieces. Take the days remaining in the first month, add the full months in between, then the days into the final month. From 20 January to 5 February: January has 31 days, so 31 − 20 = 11 days left in January, plus 5 days into February, gives 16. For longer spans you add the whole calendar months (in days) in the middle. Piece by piece, it always resolves.

Leap years and month lengths

The traps are the calendar's irregularities. Months run 28, 29, 30 or 31 days, so you can't assume a fixed length. February is the wildcard: 28 days most years but 29 in a leap year — those divisible by 4, except full centuries not divisible by 400. A span crossing 29 February gains a day you'd miss with mental maths. This is exactly why a date calculator earns its keep on long or leap-crossing gaps.

Inclusive or exclusive?

One more decision changes the answer by a day: do you count both endpoints, or just the gap between them? A hotel stay counts nights, so 10th to 12th is two nights (exclusive of the last day). A notice period or an event countdown often counts both the start and end day (inclusive). Neither is 'right' — it depends on what you're measuring — but always be clear which you mean, especially for deadlines and contracts.

Date difference calculatorCount the days, weeks and months between two dates.Try the tool

Frequently asked questions

How do I count the days between two dates?
Subtract the earlier date from the later one, minding month lengths and leap years.
Do I count both the start and end date?
It depends: a hotel counts nights (exclusive), while a notice period often counts both.
How many days are in a leap year?
366, because February has 29 days instead of 28.

Articles you may find interesting

All guides

Related tools

Sources

Spotted a mistake in this article?