Days Between Dates

Calculate the number of days between two dates

Fast, accurate calculations with clear results. Built for speed and ease of use.

Formula

Calculate date difference

How to Use Days Between Dates

  1. Enter the required values in the input fields.
  2. Review the formula and methodology used.
  3. Check the calculated results below.
  4. Use the results for your specific needs.

Examples

Example 1
Input
startDate: 2024-01-01
endDate: 2024-12-31
Output
days: 366
weeks: 52.3
months: 12

The number of days between two dates depends on whether you count both endpoints or only the gap between them, and the two answers differ by exactly one, which is the single most common source of off-by-one errors in scheduling, billing, and eligibility windows.

The formula

exclusive days = end date - start date; inclusive days = exclusive days + 1
end date
the later date
start date
the earlier date

Worked example

From 1 June 2026 to 30 June 2026, the exclusive count, a straight date subtraction, gives 29 days. Counting every day including both 1 June and 30 June, the way you would count 'how many days are in June', gives 30 days. A hotel booking for those dates is 29 nights, but a rental agreement covering 'the month of June' is 30 days, and using the wrong one of the two changes an invoice.

What trips people up

  • Date subtraction alone always gives the exclusive count; add 1 only when both endpoints genuinely belong to the span you are measuring.
  • 'Number of nights' and 'number of days' for the same two dates are not the same number, which is why hotel and rental pricing can look inconsistent.
  • Crossing a leap day inside the range adds a day that a naive month-times-30 estimate would miss entirely.
  • Time components matter if the dates include a time of day; midnight of the end date is a different moment from 23:59 of the same calendar date.

Frequently asked questions

Should I count both dates or just the gap between them?
It depends what the count represents. Nights stayed, elapsed time, and most scheduling gaps use the exclusive count; anything phrased as 'how many days does X cover' usually wants the inclusive count, both endpoints included.
Why do I get a different number of days if I include weekends versus excluding them?
Total calendar days between two dates and business days between them are different questions; business day counts need weekends, and often public holidays, removed from the total before reporting a figure.
Does the day count change if a leap day falls inside the range?
Yes, any 29 February inside the span adds one extra day to the total compared with the same date range one year later or earlier where no leap day falls.
How do I count days between two dates in different years?
The subtraction works the same regardless of whether the two dates share a year, since both are converted to a single day count first, then subtracted.
What is the most common mistake people make with this calculation?
Assuming a subtraction of the two dates already includes both endpoints, when a plain subtraction always gives the exclusive count and needs a manual plus one for the inclusive version.

Related Time & Date Calculators