Skip to main content
CalcMax

Day Counter

Result

31 days

Total days

Including both ends
31 days
Excluding the end date
30 days

This day counter answers the question a plain date difference leaves open: does the last day count? Enter two dates and the page gives both readings at once — the days between them, and the days including both endpoints — while a checkbox decides which of the two the headline figure shows. Three nights from Friday to Monday is the case that makes it obvious: the stay is three nights and four days, and both answers are right depending on what is being counted. The dates can be typed in either order, because a span is a distance and has no direction. Leap days are counted like any other day.

Formula

days between = the number of midnights crossed from the earlier date to the later one; inclusive days = that number + 1, counting both endpoints as a day each

startDate
The first of the two dates, written as YYYY-MM-DD. Which one is earlier does not matter — the order can be swapped freely
endDate
The second date. It is not required to come after the first, and the answer is identical either way
includeEndDate
The checkbox that picks the convention: off counts the days between the two dates, on counts both endpoints as well. It changes the headline only — the other two rows are always shown
totalDays
The headline count, following the checkbox. It is the same number as one of the two rows below it, never a third answer
inclusiveDays
The count with both the first and the last day included, as an attendance sheet or a medication course counts them
exclusiveDays
The count of days strictly between the two dates, as a hotel counts nights or a rental counts days

Use it whenever an off-by-one would look like an error on paper: a hotel stay priced per night, a rental period, a course of medication that runs from the first day to the seventh, a leave request, a probation or notice period, or a project billed per day. The two counts differ by exactly one, so write down which one the number is meant to be before quoting it — the checkbox is here so that both readings are visible rather than assumed. For a breakdown into years, months and days, or for a count that skips weekends and public holidays, a different page does that; this one counts every calendar day in the range.

Worked examples

  1. Three nights from Friday to Monday

    1. Travelling from Friday 2 January to Monday 5 January crosses three midnights: the ones that start Saturday, Sunday and Monday
    2. Counted between the dates that is 3 days — the number of nights, and the number a hotel or a rental agreement uses
    3. Counted with both endpoints as days it is 3 + 1 = 4 days, which is what an attendance sheet or a leave request usually means
    4. The checkbox is off here, so the headline reads 3 while the inclusive row still shows 4

    Both numbers describe the same stay; neither is a rounding of the other. The one-day gap is the whole reason this page exists rather than a single date difference, and the description of a booking will use whichever convention the business chose.

  2. The same date typed twice

    1. No midnight falls between the two dates, so the days between them is 0
    2. With the endpoints counted it is 0 + 1 = 1: the date itself is one day on a calendar
    3. The checkbox is on, so the headline follows the inclusive reading and shows 1
    4. Switch the checkbox off and the headline becomes 0 without either row below it changing

    This is the widest the two conventions ever get apart in proportion: 0 and 1. It is also the case a single date difference cannot express at all, because it has no way of saying whether the date itself counts.

  3. Across the leap day

    1. 2024 is a leap year, so 29 February exists and sits between the two dates
    2. Days between the two: 29 February lies in the middle and has to be crossed, so there are two midnights on the way and the count is 2
    3. Adding the endpoints gives 3 days, and the checkbox is off so the headline reads 2
    4. The same pair of dates in a common year such as 2026 gives 1 day, because there is no 29 February to cross

    The leap day is not special-cased anywhere: 29 February is simply a date like any other, and the count follows the calendar. It is worth entering this pair once in a leap year and once in a common year to see that the answer is the calendar's, not a fixed rule.

Limitations

The result is a count of whole calendar days, so a partial day never appears: 9 a.m. on one date to 9 a.m. on the next is one day, and so is 11 p.m. to 1 a.m., because only the dates are read and the times of day are not entered at all. Every day in the range is counted, so weekends and public holidays are included — a business day count is a different question with a different answer. There is no breakdown into years, months and weeks, only the two day counts. Dates must exist: 30 February is refused rather than rolled forward to 1 March. The supported range is 1 January of year 1 to 31 December of year 9999, and both endpoints may be typed in either order with no change to the result.

Frequently asked questions

Which of the two numbers should I use?
The one that matches what is being counted. Use the days between the dates when each day is a night, a rental day or a 24-hour period that starts on the first date — a stay from Friday to Monday is three nights. Use the inclusive days when the first date is itself day one, as on a medication course, an attendance sheet or a leave request. The two differ by exactly one, so quoting the wrong one is a visible error, and this page shows both so the choice can be checked rather than assumed.
How many days are there in January?
Thirty-one, counting from the 1st to the 31st with both ends included, and thirty counting the days between them. Enter 1 January and 31 January: with the checkbox on the headline reads 31, and with it off the headline reads 30 while the inclusive row still shows 31. The month's length is not a special case here — any first-to-last pair works the same way.
Do I count the first day, the last day, or neither?
That is exactly what the checkbox decides, and both conventions are in everyday use. Days between counts neither endpoint as a day of its own, which is how a hotel counts nights; inclusive days counts both, which is how a course that runs from the 1st to the 7th is seven days long. Because both readings are computed, turning the checkbox on and off never changes the two rows below the headline — only which of them the headline mirrors.
What happens if I swap the two dates?
Nothing at all. A span is a distance, so the count is the same whichever date is entered first, and there is no negative answer to worry about. Entering 5 January as the start and 2 January as the end gives exactly the numbers the other order gives. The order matters only in the prose of an answer — which date a stay began on is a different question from how many nights it lasted.
Is this the same as a date calculator?
No, and the difference is what comes out. A date calculator breaks a gap into years, months and days — how far apart two dates are in calendar terms. This page answers how many days the range covers, under one of two conventions, and deliberately leaves the breakdown out so that the same figure is not published on two pages. For a count that skips weekends and public holidays, that is the business days calculator, which gives a smaller number than this one.

References

Related calculators