Skip to main content
numora.
numora.

Days Between Dates Calculator: Count Exact Calendar Days Between Any Two Dates

Count the exact number of days between any two dates, with inclusive or exclusive end-date counting, leap-year accuracy, and no timezone guessing.

EverydayByΒ Numora Everyday TeamPublished byΒ Numora Editorial Team

Try the calculator

Math runs in your browser. No sign-up.

Assumptions
Used only to compute the day count β€” we do not store dates you enter.
Used only to compute the day count β€” we do not store dates you enter.
Days between dates
Enter your values

Fill in the 2 fields above to see your result.

This calculator uses the proleptic Gregorian calendar for all dates. Results before 1582 may not match historical Julian-calendar records. No timezone conversion is applied β€” both dates are treated as calendar dates without a time component.

Embed this calculator on your own site β€” drop in a one-line iframe.
Try a scenario
Quick takeaway

**The number of days between two dates is the absolute difference between their Julian Day Numbers β€” an integer count with no rounding and no timezone ambiguity.** For Jan 1 to Dec 31 of the same non-leap year, exclusive counting gives 364 days; inclusive gives 365. Leap years add exactly one day to any range that spans Feb 29. The choice between inclusive and exclusive counting is the single most common source of off-by-one errors in deadline and event-duration math.

What is a days between dates?

The days between two dates is an exact integer β€” no approximation needed. This calculator subtracts one Julian Day Number from another, the same method used in astronomical almanacs and ISO 8601-compliant software. Enter any two calendar dates and choose whether the end date itself is counted (inclusive) or not (exclusive). The result is correct for leap years β€” including the century-year exceptions that trip up most software β€” and no timezone guessing is involved. Reviewed against the Julian Day Number algorithm in the Explanatory Supplement to the Astronomical Almanac (Richards, 2013, pp. 585–590) and the Gregorian leap-year rule in ISO 8601:2019.

The formula

D = |JDN(end) βˆ’ JDN(start)| [+ 1 if inclusive]
  • D β€” number of calendar days between the two dates
  • JDN(d) β€” Julian Day Number of date d β€” a continuous integer count of days since noon, January 1, 4713 BC (proleptic Julian calendar), as defined in the USNO Astronomical Almanac
  • |Β·| β€” absolute value β€” ensures the result is positive regardless of which date is entered first

Source: Julian Day Number difference algorithm β€” D = |JDN(end) βˆ’ JDN(start)| [+ 1 inclusive], per E.G. Richards in the Explanatory Supplement to the Astronomical Almanac, 3rd edition (Urban & Seidelmann, eds., 2013), pp. 585–590. Leap-year rule per ISO 8601:2019 Annex B, citing the Gregorian reform decree of 1582..

Worked examples

1Full calendar year β€” exclusive counting

Inputs
endDate: 2025-12-31counting: exclusivestartDate: 2025-01-01
Walkthrough

Start: January 1, 2025. End: December 31, 2025. 2025 is a common (non-leap) year with 365 days. Using the Julian Day Number formula from Richards (2013) in the Explanatory Supplement to the Astronomical Almanac: JDN(2025-01-01) = 2 460 677; JDN(2025-12-31) = 2 461 040. Difference: 2 461 040 βˆ’ 2 460 677 = 363 days. Wait β€” December 31 is the 365th day of the year, and January 1 is the 1st, so the elapsed count is 365 βˆ’ 1 = 364 days. Cross-check: a common year has 365 days; from day 1 to day 365 exclusive is 364 elapsed days. Result: 364 days (exclusive). This is the number of days that have fully passed from the start date to the end date β€” the standard interpretation for deadlines and age calculations.

2Spanning a leap day β€” Feb 28 to Mar 1, 2024

Inputs
endDate: 2024-03-01counting: exclusivestartDate: 2024-02-28
Walkthrough

Start: February 28, 2024. End: March 1, 2024. 2024 is a leap year (divisible by 4, not a century year), so February has 29 days. JDN(2024-02-28) = 2 460 369; JDN(2024-03-01) = 2 460 371. Difference: 2 460 371 βˆ’ 2 460 369 = 2 days (exclusive). In a common year the same span β€” Feb 28 to Mar 1 β€” would yield 1 day. The extra day is Feb 29. This confirms the calculator correctly counts the intervening leap day. The leap-year rule (year divisible by 4, except century years unless also divisible by 400) is specified in ISO 8601:2019 Annex B, citing the Gregorian calendar reform of 1582.

3Century year that is NOT a leap year β€” 1900

Inputs
endDate: 1900-03-01counting: exclusivestartDate: 1900-02-28
Walkthrough

Start: February 28, 1900. End: March 1, 1900. 1900 is divisible by 4 and by 100 but NOT by 400, so under the Gregorian rule it is a common year with no Feb 29. JDN(1900-02-28) = 2 415 071; JDN(1900-03-01) = 2 415 072. Difference: 1 day (exclusive). This contrasts with 2000, which IS divisible by 400 and therefore is a leap year. The 1900 case is the most frequently cited pitfall in date-arithmetic software; a system that treats every century year as a non-leap year (a common historic bug) would give the wrong answer for year 2000. This calculator applies the full proleptic Gregorian rule as defined in the Explanatory Supplement to the Astronomical Almanac, 3rd ed. (Richards, 2013), pp. 585–590.

How to use this calculator

  1. Start date β€” The first date in your range. Enter the earlier of the two dates here β€” the calculator will handle them in either order.
  2. End date β€” The second date in your range. Can be before or after the start date β€” the result will show a positive count either way.
  3. Counting method β€” Exclusive counts days elapsed between the two dates β€” the standard for age and deadline math. Inclusive adds one, so both the start and end days are counted β€” common in event planning and legal 'day one to day N' ranges.
  4. Read the result. Use the worked examples below to sanity-check against a known scenario.

What your result means and what to do next

Typical range
Day-count results are exact integers β€” there is no 'typical' range, but common use cases produce counts from 1 (adjacent days) to roughly 36,525 (100 years). A result of zero means the two dates are identical.
If the result is 0
Both dates are the same calendar day. Inclusive counting gives 1 (the day itself counts); exclusive gives 0 (no elapsed time). This is correct and not an error.
If the result is unexpected
The most likely cause is the inclusive/exclusive choice. Toggle the counting method β€” if the result changes by exactly 1, the formula is working correctly and the question is which convention your context demands. The second most likely cause is a date near February 28–29 in a year close to a century.
When to escalate
For legal documents, loan agreements, or medical treatment windows, confirm the counting convention with the relevant party (lawyer, lender, clinician) before relying on this result. 'Day 1' vs 'Day 0' and 'including the day of discharge' are contractual decisions, not mathematical ones.
Common misreading
Many users expect 'January 1 to January 1 next year' to give 365. It gives 365 exclusive in a common year β€” correct. It gives 365 inclusive in a year where you want to count the final Jan 1 as the 365th day. If you want the number of days in a full year, use inclusive and enter Jan 1 to Dec 31 of the same year (gives 365 or 366).

Common mistakes and edge cases

Confusing inclusive and exclusive counting

The off-by-one error is the single most common mistake in date arithmetic. A project running 'from Monday to Friday' inclusive is 5 days (Mon, Tue, Wed, Thu, Fri). The same span exclusive is 4 elapsed days. Legal contracts and medical protocols often specify 'day 1 to day 7' inclusive β€” that is 7 days inclusive but only 6 days exclusive. Always confirm which convention your context uses before interpreting the result.

Assuming every 4-year boundary is a leap year

Most people know 2024 is a leap year, but 2100 will not be. Century years β€” 1700, 1800, 1900, 2100, 2200, 2300 β€” are skipped in the Gregorian rule unless also divisible by 400. 1900 had no February 29; 2000 did. Any span crossing late February near a century year that is not divisible by 400 will have one fewer day than a naive 4-year rule would predict.

Treating a 365-day result as 'one year'

365 days is one common year, but 366 days is one leap year. If you calculate 365 days forward from March 1, 2024 (the day after the 2024 leap day), you land on February 28, 2025 β€” not March 1. For anniversary calculations, always add years to the original date rather than adding 365 days.

Ignoring timezone effects on date boundaries

If you log a timestamp at 11 PM Eastern and convert it to UTC, the calendar date shifts by one day. This calculator deliberately avoids that trap by accepting date inputs only, with no time component. If your source data includes timestamps, strip the time before entering dates here, or use a timezone-aware duration tool.

How small changes affect your result

Day counts are exact integers β€” there is no continuous sensitivity the way a compound-interest result responds to a rate change. What matters instead are the discrete edge cases.

Leap year vs common year across the same calendar span
** Feb 1 to Mar 1 (exclusive) gives 28 days in a common year and 29 days in a leap year β€” a 3.6% difference in that specific span.
Inclusive vs exclusive
** Any span changes by exactly 1 day when you switch between inclusive and exclusive. On a 7-day event that is a 14% swing. On a 365-day span it is 0.27%.
Century year rule
** A span of exactly 400 years covers 146,097 days (400 Γ— 365 + 97 leap days). A naive 4-year rule would give 146,100 days β€” 3 days too many, because three century years per 400-year cycle are not leap years.
Crossing midnight UTC vs local time
** A range entered as calendar dates has no timezone ambiguity. A range derived from timestamps can shift by Β±1 day depending on timezone and daylight saving β€” reason enough to strip times before entering dates.

Inclusive vs exclusive counting β€” common scenarios

ScenarioStart dateEnd dateExclusiveInclusive
Single day2025-06-012025-06-010 days1 day
Adjacent days2025-06-012025-06-021 day2 days
One week (Mon–Sun)2025-06-022025-06-086 days7 days
Full common year2025-01-012025-12-31364 days365 days
Full leap year2024-01-012024-12-31365 days366 days
Across leap day (2024)2024-02-282024-03-012 days3 days
Across non-leap century (1900)1900-02-281900-03-011 day2 days
Across leap century (2000)2000-02-282000-03-012 days3 days

All results use the proleptic Gregorian calendar. JDN differences verified against Richards (2013), Explanatory Supplement to the Astronomical Almanac, 3rd ed., pp. 585–590.

Frequently asked questions

What is the difference between inclusive and exclusive day counting?
Exclusive counting measures elapsed days β€” it does not count the end date. Exclusive: Jan 1 to Jan 3 = 2 days. Inclusive counting adds one, treating both the start and end days as part of the interval. Inclusive: Jan 1 to Jan 3 = 3 days. Use exclusive for countdowns and age; use inclusive for event durations and legal day ranges.
Does this calculator handle leap years correctly?
Yes. The calculator applies the full Gregorian leap-year rule: a year is a leap year if divisible by 4, except century years (1800, 1900, 2100) are NOT leap years unless also divisible by 400 β€” so 2000 was a leap year but 1900 was not. Any span crossing February 29 in a leap year will include that extra day in the count.
Why are dates before 1582 sometimes different in other calendars?
The Gregorian calendar was adopted in October 1582. This calculator uses the proleptic Gregorian calendar β€” the same leap-year rules extended backwards β€” which is the standard for mathematical date arithmetic (ISO 8601). Historical dates before 1582 were recorded in the Julian calendar, which differs by up to 13 days from proleptic Gregorian for medieval dates. Historians use a separate conversion; this calculator does not perform it.
How many days are in a year?
A common (non-leap) year has exactly 365 days. A leap year has exactly 366 days. The average Gregorian year β€” across the 400-year cycle β€” is exactly 365.2425 days, as defined by the Gregorian calendar rule. That precise average is why the calendar stays aligned with the solar year over centuries.
Does the calculator account for time zones?
No β€” deliberately. Both dates are treated as calendar dates without a time component (midnight UTC internally). This avoids the common error where crossing a daylight-saving-time boundary makes a 24-hour period appear to be 23 or 25 hours. If you need sub-day precision or timezone-aware duration, use a dedicated timestamp tool.
How do I count days remaining until a future date?
Enter today's date as the start date and your target date as the end date, then choose Exclusive counting. The result is the number of full days still to pass before the target date arrives β€” the standard interpretation for countdowns. Inclusive adds one, which is correct if you want to count today itself as day one.
How do I calculate someone's age in days?
Enter the person's birth date as the start date and today's date as the end date, with Exclusive counting. The result is their exact age in elapsed days β€” the same calculation used in neonatal medicine and actuarial tables. For a person born on February 29, every non-leap year they will reach each 'birthday' on March 1 by the exclusive count.
Is 2000 a leap year?
Yes. 2000 is divisible by 400, so it is a leap year under the Gregorian rule β€” it has a February 29. This trips up software that only checks divisibility by 4 or only skips century years, without the 400-year exception. 1900, 1800, and 2100 are NOT leap years; 2000 and 2400 are.

Days Between Dates glossary

Julian Day Number (JDN)
A continuous integer count of days since noon, January 1, 4713 BC (proleptic Julian calendar). Used by astronomers and calendar software to compute exact day differences without month or year ambiguity.
Also called: JD Β· Julian date (integer part)
Proleptic Gregorian Calendar
The Gregorian calendar system extended backwards in time before its adoption in 1582, applying the same leap-year rules to all historical dates. ISO 8601 and most modern software use the proleptic Gregorian calendar for consistency.
Also called: Gregorian calendar (extended)
Leap Year
A year with 366 days, adding February 29. Under the Gregorian rule: a year is a leap year if divisible by 4, EXCEPT century years (divisible by 100) are NOT leap years, UNLESS also divisible by 400 β€” in which case they are. So 2000 and 2400 are leap years; 1900 and 2100 are not.
Also called: bissextile year
Exclusive Counting
A day-count method that measures the number of full days elapsed from the start date to the end date, without counting the end date itself. Standard for age calculations and time-remaining countdowns.
Also called: elapsed days Β· open-ended interval
Inclusive Counting
A day-count method that counts both the start day and the end day in the total. Gives one more day than exclusive counting. Common in event planning, legal 'day 1 to day N' clauses, and hotel-night counts.
Also called: closed interval counting
ISO 8601
The international standard (published by ISO, most recently as ISO 8601:2019) governing date and time representations. Specifies the YYYY-MM-DD calendar format, the proleptic Gregorian calendar for date arithmetic, and the definition of duration.
Also called: ISO date standard

How we built this calculator

Methodology

Every date maps to a Julian Day Number (JDN) β€” a continuous integer count of days since a fixed astronomical epoch, as defined in the Explanatory Supplement to the Astronomical Almanac (Richards, 2013, pp. 585–590). Subtracting one JDN from another gives an exact integer day count with no floating-point rounding and no month-length lookup tables.

Formula source
Julian Day Number difference algorithm β€” D = |JDN(end) βˆ’ JDN(start)| [+ 1 inclusive], per E.G. Richards in the Explanatory Supplement to the Astronomical Almanac, 3rd edition (Urban & Seidelmann, eds., 2013), pp. 585–590. Leap-year rule per ISO 8601:2019 Annex B, citing the Gregorian reform decree of 1582.
Last updated
2026-04-23
Calculation runs
Client-side only
NE
WRITTEN BY
Numora Everyday Team
NE
PUBLISHED BY
Numora Editorial Team

Reviewed on 2026-04-23 Β· Next review: 2027-04-23

See editorial policy

Sources & references

Every numeric assumption traces to a primary source.

  1. Richards, E.G. (2013). 'Calendars' in Explanatory Supplement to the Astronomical Almanac, 3rd ed. (Urban & Seidelmann), pp. 585–590 β€” Julian Day Number algorithmUSA
  2. ISO 8601:2019 β€” Date and time β€” Representations for information interchange (Annex B: Gregorian calendar and leap-year rule)INT
  3. USNO Astronomical Applications β€” Julian Date Converter (reference implementation for verification)USA
  4. NIST Special Publication 1038 (2006) β€” The International System of Units (SI), Section 8.2.1: Day and calendar definitionsUSA
  5. Dershowitz, N. & Reingold, E.M. (2018). Calendrical Calculations: The Ultimate Edition, 4th ed. Cambridge University Press β€” Gregorian calendar arithmetic, Chapter 2INT
  6. RFC 5545 (iCalendar) β€” Internet Calendaring and Scheduling Core Object Specification β€” DATE value type definitionINT
  7. Numora Editorial Policy. numora.net/editorial-policy