How to use the date overlap calculator
- Enter the start and end dates of the first range.
- Enter the start and end dates of the second range.
- Keep Count both the first and last day on if you want January 6 to 10 to count as 5 days, or turn it off to count 4, the difference between the dates.
- Read the number of overlapping days, the dates the overlap starts and ends, and each range's share.
Formula
Overlap start = the later of the two start dates
Overlap end = the earlier of the two end dates
Overlap days = overlap end - overlap start + 1 when both end dates count, or without the + 1 otherwise
If the overlap start is after the overlap end, there is no overlap, and the gap = start - end - 1 days
Dates are converted to whole day numbers first, so time zones and daylight saving time never change the result.
Two January ranges
The first range is January 1 to 10, 2026 (10 days) and the second is January 6 to 20 (15 days). The later start is January 6 and the earlier end is January 10, so they overlap from January 6 to 10, which is 5 days counting both ends. That is 50% of the first range and 33.3% of the second, and the two ranges together cover 20 days.
With the option off the same overlap is 4 days. If the second range were January 15 to 20 the ranges would not meet, and 4 days (January 11 to 14) would sit between them.
Inclusive and exclusive counts
Counting both the first and last day is common for stays, leave and contracts described by dates. Counting the difference between dates matches nights in a hotel, where a stay from the 6th to the 10th is four nights.
Which one is right depends on the rule you are working with. The tool shows the same ranges both ways, so you can pick the one that matches.
What the tool covers
It works with whole calendar days and ignores times of day and business-day rules. It compares exactly two ranges. For a longer list, compare them in pairs.
For the length of one range use the days between dates calculator, and to count only working days use the business days calculator. To move a date forward or back use the date calculator.
Assumptions and limits
- Both ranges are made of whole calendar days.
- Each range ends on or after its start date.
- Times of day, time zones and daylight saving time are not part of the calculation.
- Weekends and holidays are counted like any other day.
Frequently asked questions
How do you find the overlap between two date ranges?
Take the later of the two start dates and the earlier of the two end dates. If the start is not after the end, the days between them, counting both ends, are the overlap.
What if the date ranges do not overlap?
The tool says there is no overlap and shows how many days fall between the two ranges.
Why does the count change when I turn off the option?
With both days counted, January 6 to 10 is 5 days. Without it, the count is the difference between the dates, which is 4.
Does the tool handle leap years?
Yes. Each date becomes a day number on the Gregorian calendar, so February 29 in a leap year is counted correctly.