Days Between Dates
Calculate the exact number of days between any two dates.
Written by Golam Rabbani, Founder & Lead Engineer
How to use this days between dates
- Pick a start date.
- Pick an end date.
- Press Calculate to see the total days between them.
- Read the breakdown for weeks, approximate months, weekdays, and weekend days.
- Use Copy to grab the headline, or Reset to start over.
About this days between dates
The days-between-dates calculator counts the whole calendar days between any two dates, then breaks the gap down into weeks-plus-days, approximate months, and a weekday-versus-weekend split. It is the right tool when you need an integer day count — for project planning, rental durations, contract terms, or trivia.
Behind the scenes the calculator constructs two local-date objects from the year/month/day you enter (using `new Date(y, m-1, d)` so the value is anchored to local midnight rather than UTC), then divides the absolute millisecond gap by 86,400,000. The weekday-vs-weekend split iterates one day at a time using local-calendar arithmetic, so DST transitions and month boundaries are handled correctly. We assume a Saturday-and-Sunday weekend; if your jurisdiction has a Friday-and-Saturday weekend, the split labels will be reversed in meaning.
For example, 2024-01-01 to 2024-12-31 returns 365 days (52 weeks + 1 day), about 12 months, with 261 weekdays and 104 weekend days. Reverse the dates and the calculator still returns 365, with a note that the inputs were reversed. The day count itself is always an absolute integer; ordering does not affect it.
FAQ
- Does it matter which date I put first?
- No. The calculator detects when the end date is before the start date, swaps them internally, and shows a small note. The day count is always the absolute difference.
- How are weekdays and weekend days counted?
- The tool walks the calendar one day at a time and tallies each day's weekday. The earlier date is counted; the later date is not (so the totals sum to the day count). Saturday and Sunday are treated as the weekend.
- Why is the month figure described as "approximate"?
- Because months have different lengths, the month figure is the count of full calendar months between the two dates — borrowing days when the end day-of-month is earlier than the start. It will not equal days ÷ 30.
- Does it handle leap years?
- Yes. Native JavaScript dates count leap days correctly, so 2020-01-01 to 2021-01-01 returns 366 days.
- Is the calculator free?
- Yes. Everything runs in your browser. No signup, no logs, no rate limits.