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.
Try the calculator
Math runs in your browser. No sign-up.
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.
The days between two dates equals the absolute difference of their Julian Day Numbers β an exact integer requiring no rounding. From January 1 to December 31 in a common year, exclusive counting yields 364 days; inclusive yields 365. The only decision that changes the result is whether the end date itself is counted, not any approximation in the formula.
**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 β 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
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
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
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
- Start date β The first date in your range. Enter the earlier of the two dates here β the calculator will handle them in either order.
- 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.
- 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.
- Read the result. Use the worked examples below to sanity-check against a known scenario.
What your result means and what to do next
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.
Inclusive vs exclusive counting β common scenarios
| Scenario | Start date | End date | Exclusive | Inclusive |
|---|---|---|---|---|
| Single day | 2025-06-01 | 2025-06-01 | 0 days | 1 day |
| Adjacent days | 2025-06-01 | 2025-06-02 | 1 day | 2 days |
| One week (MonβSun) | 2025-06-02 | 2025-06-08 | 6 days | 7 days |
| Full common year | 2025-01-01 | 2025-12-31 | 364 days | 365 days |
| Full leap year | 2024-01-01 | 2024-12-31 | 365 days | 366 days |
| Across leap day (2024) | 2024-02-28 | 2024-03-01 | 2 days | 3 days |
| Across non-leap century (1900) | 1900-02-28 | 1900-03-01 | 1 day | 2 days |
| Across leap century (2000) | 2000-02-28 | 2000-03-01 | 2 days | 3 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?
Does this calculator handle leap years correctly?
Why are dates before 1582 sometimes different in other calendars?
How many days are in a year?
Does the calculator account for time zones?
How do I count days remaining until a future date?
How do I calculate someone's age in days?
Is 2000 a leap year?
Days Between Dates glossary
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.
Sources & references
Every numeric assumption traces to a primary source.
- Richards, E.G. (2013). 'Calendars' in Explanatory Supplement to the Astronomical Almanac, 3rd ed. (Urban & Seidelmann), pp. 585β590 β Julian Day Number algorithmUSA
- ISO 8601:2019 β Date and time β Representations for information interchange (Annex B: Gregorian calendar and leap-year rule)INT
- USNO Astronomical Applications β Julian Date Converter (reference implementation for verification)USA
- NIST Special Publication 1038 (2006) β The International System of Units (SI), Section 8.2.1: Day and calendar definitionsUSA
- Dershowitz, N. & Reingold, E.M. (2018). Calendrical Calculations: The Ultimate Edition, 4th ed. Cambridge University Press β Gregorian calendar arithmetic, Chapter 2INT
- RFC 5545 (iCalendar) β Internet Calendaring and Scheduling Core Object Specification β DATE value type definitionINT
- Numora Editorial Policy. numora.net/editorial-policy