—
—
Counting the days between two dates
Counting days across months is error-prone by hand because month lengths vary and February changes every fourth year. This date difference calculator does it exactly, returning the gap in days and in weeks. It is the tool for contract terms, notice periods, project deadlines and counting down to an event.
How to use the Date Difference Calculator
- Pick a Start Date.
- Pick an End Date.
- Read the difference in days and weeks.
- Reverse the dates to count down to a future event.
Formula and a worked example
Days = (end date − start date) ÷ 86,400,000 milliseconds
Weeks = days ÷ 7
Working in milliseconds since the epoch sidesteps month lengths and leap years entirely — the calendar arithmetic is handled before the subtraction. The count is exclusive of the start date and inclusive of the end date.
Worked example
From 1 January 2026 to 23 August 2026 is 234 days, or about 33.4 weeks. Crossing a leap day adds one more than you might expect from counting month lengths.
Frequently asked questions
Does the count include both the start and end dates?
It counts the days between them — the end date is included, the start date is not. Add one if you need both endpoints counted.
Are leap years handled?
Yes, automatically. Any 29 February in the range is included in the total.
Can I count business days only?
Not directly. Divide the total by 7 and multiply by 5 for an approximation, then adjust for public holidays.
How do I work out someone's age instead?
Use our age calculator, which breaks the gap into years, months and days.
Related calculators
Other tools people use alongside the date difference calculator.