Days between two dates calculator

The Days Between Dates calculator measures the elapsed calendar-day gap between valid YYYY-MM-DD inputs. It respects month lengths and leap days. The page displays the absolute number and flags a reversed range; approximate month and year cards are orientation aids, not exact results.

Use the result as elapsed calendar distance for trips, milestones, projects, and date-only planning. It is not an official contract, regulatory, payroll, or legal-age ruling. Record both inputs, endpoint convention, and separate workday, holiday, timezone, or policy rules. reviewedAt records content update and engine testing, not official human review.

How this is calculated

daysBetweenDates computes end date minus start date after normalizing both to the start of their dates. Monday to Tuesday is 1 and the same date is 0. This is not an inclusive count: add one only when a policy counts both endpoints. It is not a weekday, business-day, holiday, overnight, or legal-age calculation. Approximate months and years use average-length divisors, so retain the day result.

Assumptions and limits

Worked examples

Leap day counts in the gap

Inputs: Start 2024-02-28; end 2024-03-01

Result: 2 calendar days

February 29 lies between the endpoints; an inclusive policy would count 3 displayed dates.

January is not an automatic 30-day month

Inputs: Start 2026-01-01; end 2026-01-31

Result: 30 calendar days

The engine measures the gap; an inclusive rule would count 31 dates.

Reversed inputs preserve engine direction

Inputs: Start 2026-09-07; end 2026-09-04

Result: 3 displayed; engine value -3

The UI shows the absolute gap and says the end comes first; reverse inputs for a forward countdown.

Boundary cases

Common mistakes

Continue your planning

Calendar Days vs Business Days: Which Count Should You Use?

Content updated · Maintained by NoteMide · Report a correction

Frequently asked questions

Are the start and end dates included?

The main number is the elapsed gap: January 1 to January 31 is 30 days. Add one only when both endpoints must count, and label it inclusive.

What does a reversed range mean?

The engine returns a negative difference when the end precedes the start. The UI displays the absolute value and identifies that the end comes first.

Does it include leap years?

Yes. Calendar-aware subtraction includes February 29 when the selected year has it.

Can it count workdays or holidays?

No. Use Business Days for weekday and selected-holiday counting, then verify the employer or regional rule.

Why are months and years approximate?

Calendar months and years have unequal lengths, so those cards use average-length estimates. Keep the day count for exact planning.