Free date difference and day-counting tool
Days Between Dates Calculator
Calculate the days between two dates. Compare elapsed, inclusive and exclusive counts with signed direction, calendar years, months, days, weeks and date-only time units.
Last Updated: July 24, 2026
Calculate Days Between Two Dates
Enter the two calendar dates, then choose which boundary dates should count.
A days between dates calculator finds the number of calendar-day boundaries separating two dates. It answers questions such as “How many days are between these dates?”, “How long is this date range?” and “How many weeks and days have passed?” The result works for past, present or future dates within the supported range.
The calculator keeps three ideas separate. The standard elapsed gap measures completed day boundaries. The signed difference preserves the order in which you entered the dates. The inclusion-adjusted count applies your choice to include or exclude the start and end dates. This separation prevents a one-day counting rule from looking like a calculation error.
How to Use the Days Between Dates Calculator
- Enter the start date.
- Enter the end date, or select “Use Today as End.”
- Choose whether to include the start date, end date, both dates or neither date.
- Select the month-end rule for the calendar years, months and days breakdown.
- Select “Calculate Date Difference.”
- Read the selected day count, standard elapsed gap and signed difference.
- Review the calendar breakdown, weeks, time units and audit table.
- Use “Swap Dates” to reverse the entered direction without retyping either date.
What Does “Days Between Dates” Mean?
The standard result is an elapsed-day difference. The start date is the zero point. If the start and end dates are identical, zero day boundaries have passed. Moving the end date to the following calendar date produces one elapsed day.
An inclusive schedule asks a different question. It counts calendar dates touched by a range, not only the boundaries passed. January 1 through January 2 contains one elapsed day but two calendar dates when both ends count. The calculator shows the standard gap under every setting so you can compare methods directly.
The result uses plain Gregorian dates. It does not collect clock times or time zones. A “day” here is a calendar-date step, which differs from an exact timestamp interval across daylight-saving transitions.
Days Between Dates Formula
Each input is converted to a stable serial day number. The difference between those numbers gives the signed entered interval. Its absolute value gives the standard gap regardless of which date was entered first.
Including only one boundary leaves the numeric total equal to the standard elapsed gap. The selected rule still matters because it identifies which calendar date belongs to the counted range. For identical dates, the one-boundary and neither-boundary methods return zero, while including both returns one unique calendar date.
Worked Date Difference Example
Use January 1, 2026 as the start date and July 24, 2026 as the end date.
- The serial-date subtraction gives a signed difference of +204 days.
- The standard absolute elapsed gap is 204 days.
- Excluding the start and including the end keeps the result at 204 days.
- Including the start and excluding the end also counts 204 days.
- Excluding both boundary dates counts 203 days.
- Including both boundary dates counts 205 days.
- The calendar breakdown is 6 months and 23 days.
- The elapsed interval equals 29 complete weeks and 1 remaining day.
- The date-only equivalents are 4,896 hours and 293,760 minutes.
January 1, 2026 is a Thursday, and July 24, 2026 is a Friday. Reversing the inputs changes the signed result to −204 days. It does not change the absolute gap, inclusion-adjusted count or chronological calendar breakdown.
Inclusive and Exclusive Date Counting
There is no single correct boundary setting for every task. Duration usually excludes the starting boundary. Travel itineraries, accommodation nights, notices, court rules, subscriptions and project schedules can define their date ranges differently.
| Counting rule | January 1 to January 2 | Same date | Typical interpretation |
|---|---|---|---|
| Exclude start, include end | 1 day | 0 days | Standard elapsed-day difference |
| Include start, exclude end | 1 day | 0 days | Forward schedule where the start belongs to the range |
| Exclude both dates | 0 days | 0 days | Only dates strictly inside the two boundaries |
| Include both dates | 2 days | 1 day | Every unique calendar date from start through end |
Write the chosen method beside an important result. “204 elapsed days” and “205 dates including both ends” are both internally correct for the example. They answer different questions.
Signed Difference vs Absolute Difference
The signed difference keeps input direction. A positive result means the end date follows the start date. A negative result means the end date comes earlier. Zero means the two inputs are the same calendar date.
The absolute difference ignores direction and reports the size of the gap. This is useful when you want distance between dates rather than a forward or backward change. The main inclusion-adjusted count also uses the absolute gap, while the signed card and entered-order card preserve direction.
Use the swap button when you want to reverse a countdown or audit the sign. The chronological earlier and later cards remain correct after the swap.
Calendar Years, Months and Days Breakdown
A total day count uses one fixed unit. A calendar breakdown advances through completed Gregorian years and months before counting the remaining days. Months range from 28 to 31 days, so the breakdown cannot be obtained by dividing the elapsed total by 30.
The calculator always creates the breakdown from the earlier date to the later date. It first finds the largest whole-year anchor that does not pass the later date. It then adds the largest number of whole calendar months that still fits. The remaining serial-day difference becomes the day component.
A missing month day requires a visible rule. Under “Clamp missing days to month end,” January 31 plus one calendar month becomes the last valid day of February. Under “Preserve month-end status,” a start date that is the last day of its month stays on the last day of each target month used for the breakdown.
| Rule | Behavior | What never changes |
|---|---|---|
| Clamp missing day | Uses the requested day when valid, otherwise the target month's final day | Exact elapsed-day gap |
| Preserve month end | Keeps a chronological start that falls on month end at month end | Exact elapsed-day gap |
The rule can change only how the same interval is expressed in years, months and days. The standard elapsed gap, signed difference, weeks and time-unit cards remain unchanged.
How Leap Years Affect the Result
The U.S. Naval Observatory Gregorian rule makes years divisible by four leap years, except century years must also be divisible by 400. The year 2000 was a leap year. The years 1900 and 2100 are not. The year 2400 will be a leap year.
Serial-date subtraction includes every valid February 29 automatically. You do not need to add leap days manually. A range crossing February 29 is one day longer than the matching common-year range when the other boundaries remain comparable.
The calendar breakdown also respects valid month lengths. If a year or month anchor requests February 29 in a common year, the selected month-end rule supplies the valid boundary used for the breakdown. The exact day count stays unchanged.
Weeks, Hours and Minutes Between Dates
Complete weeks come from dividing the absolute elapsed gap by seven. The remainder is shown as extra days. A 204-day interval contains 29 complete weeks and 1 remaining day because 29 multiplied by 7 equals 203.
The NIST time-unit reference lists one day as 24 hours or 86,400 seconds. The calculator uses this fixed relationship for date-only hours and minutes.
These unit cards do not reconstruct clock time. An exact duration to the hour would need start and end times, named time zones and daylight-saving rules. Use the date-only totals for stable calendar comparisons.
Date-Only Math, Time Zones and DST
The calculator converts the entered year, month and day components to stable UTC-based serial values. This prevents a browser's local offset from shifting a date to the previous or following day during subtraction.
The “Use Today as End” button is the one feature that reads your device's local date. If the device clock or zone is wrong, the selected end date can also be wrong. Enter a fixed end date directly when the calculation needs to be repeatable.
A local civil day can contain 23 or 25 hours during a daylight-saving transition. This page still counts one calendar-date boundary. Use a time-duration or timestamp tool when the exact clock interval matters.
Practical Uses for a Date Difference Calculator
- Measure elapsed calendar days between two events.
- Compare an inclusive schedule with a standard duration.
- Find complete weeks and remaining days in a date range.
- Check whether an entered end date is before or after the start date.
- Express a long interval in calendar years, months and days.
- Audit a project, subscription, travel or study period.
- Recreate the gap between two historical dates.
- Convert a calendar-day gap into date-only hours or minutes.
For working days, public holidays or custom weekends, use a dedicated business-day tool. For age, use an age calculator with birthday and February 29 rules. Keeping those intents separate avoids hidden assumptions.
Common Date Difference Mistakes
- Counting both dates without stating it: This usually adds one day to the elapsed gap.
- Multiplying years by 365: The shortcut misses leap days and partial years.
- Treating every month as 30 days: Gregorian months have unequal lengths.
- Ignoring input order: An absolute gap hides whether the entered end date is earlier.
- Mixing calendar days with business days: Weekends and holidays need separate rules.
- Reading date-only hours as clock time: No time zone or daylight-saving history is entered.
- Using the wrong year: A plausible date can still create a large error.
- Applying a general count to a formal deadline: Laws, courts and contracts define their own inclusion rules.
Important Deadline and Eligibility Checks
A general date calculator does not determine a legal filing deadline, visa period, notice period, insurance waiting period, benefit eligibility date or contractual due date. The governing rule may exclude the event date, include the final date, move a deadline that falls on a weekend, use local holidays or apply a cut-off time.
Confirm the jurisdiction, calendar, time zone, holiday treatment and boundary rule with the responsible authority. Save the two source dates and the selected method with the result. That record makes a later review easier than saving only the final number.
Related Calculators
Browse the full Date, Time & Age Calculators directory for age, birthday, date arithmetic, day-counting and time tools.
Frequently Asked Questions
How do I calculate the number of days between two dates?
Subtract the start date's serial day number from the end date's serial day number. Use the absolute value for the size of the gap and keep the signed value when direction matters.
Are the start and end dates included?
The standard elapsed method excludes the start date and counts to the end date. This calculator also lets you include the start only, exclude both dates or include both dates.
Why is the inclusive result one day higher?
Including both endpoints counts every unique calendar date touched by the range. The elapsed gap counts boundaries passed, so a positive range with both dates included is one day higher.
What happens if the end date is before the start date?
The signed difference becomes negative, while the standard gap and selected boundary count remain nonnegative. The earlier and later date cards make the chronological order clear.
Does the calculator include leap years?
Yes. It subtracts valid Gregorian serial dates, so February 29 is included automatically when it falls inside the interval. Century years follow the divisible-by-400 exception.
Why can the years, months and days breakdown vary?
Months have unequal lengths, and some target months lack the starting day. A clamp or month-end-preservation rule can change the calendar-unit expression without changing the exact elapsed-day gap.
How are weeks between dates calculated?
The calculator divides the absolute elapsed-day gap by seven. The whole-number quotient is complete weeks, and the remainder is shown as extra days.
Does this calculator count business days and holidays?
No. It counts Gregorian calendar days. Business-day calculations need weekend settings and the holiday calendar that applies to the location, employer or authority involved.
Can I use this result for a legal or filing deadline?
Use it as an arithmetic check only. Confirm the applicable inclusion rule, holidays, weekends, jurisdiction, time zone and cut-off time with the authority responsible for the deadline.
Disclaimer: This calculator provides general Gregorian calendar estimates. It does not determine legal, tax, immigration, medical, benefits, payroll, notice or contractual deadlines. Confirm the governing boundary rule, holiday calendar, jurisdiction, time zone and cut-off time before acting on an important result.