Date Difference Calculator

Find the number of days, business days, weeks, months, or years between any two dates.

Everyday Julian Day algorithm Business days included Leap-year aware
Rate this calculator

How many days between two dates?

Calendar days · business days · weeks · months · years · weekday

Instructions — Date Difference Calculator

1

Enter your two dates

Pick the start date and end date with the date pickers. The calculator accepts any Gregorian date from year 1 to 9999. If you flip the order by mistake, hit Swap or the tool will automatically order them and warn you.

2

Choose what to count

Calendar days is the default. Switch to Business days to count weekdays only (Monday–Friday), or Weeks, Months, or Years for a higher-level breakdown. The result mode only changes the headline number; the full detail grid still shows everything.

3

Decide if the end date counts

Toggle “Include end date” ON to count both endpoints (June 1 to June 3 = 3 days). Toggle OFF to count only the interval between them (June 1 to June 3 = 2 days). Contracts and rentals differ on this point — check your wording.

Off-by-one is the classic trap. Always confirm whether the contract or task means “within” (interval) or “through” (inclusive). The two answers differ by exactly one day.
Business days assume Mon–Fri only. Public holidays are not subtracted because they vary by country, region, and year. Subtract them manually for a strict working-day figure.

Formulas

The calculator uses the Julian Day Number method — it converts each calendar date to a continuous day count, then subtracts. This makes leap years, century rules, and month-length variations disappear from the arithmetic.

DAYS BETWEEN DATES
$$ \Delta D = \text{JDN}(d_2) - \text{JDN}(d_1) $$
Convert each date to its Julian Day Number and subtract. Add 1 if both endpoints count (“through” semantics).
JULIAN DAY NUMBER (GREGORIAN)
$$ \text{JDN} = D + \left\lfloor\frac{153M+2}{5}\right\rfloor + 365Y + \left\lfloor\frac{Y}{4}\right\rfloor - \left\lfloor\frac{Y}{100}\right\rfloor + \left\lfloor\frac{Y}{400}\right\rfloor - 32045 $$
D is day of month; M is month with January and February treated as months 13 and 14 of the previous year; Y is the (adjusted) year.
LEAP YEAR RULE
$$ \text{leap}(Y) = (Y \bmod 400 = 0) \lor (Y \bmod 4 = 0 \land Y \bmod 100 \neq 0) $$
A year is a leap year if divisible by 400, or by 4 but not 100. So 2000 and 2024 are leap years; 1900 and 2100 are not.
WEEKS, MONTHS, YEARS
$$ W = \left\lfloor\frac{\Delta D}{7}\right\rfloor,\quad M \approx \frac{\Delta D}{30.4369},\quad Y \approx \frac{\Delta D}{365.25} $$
Weeks are exact. Months and years use the Gregorian averages (30.4369 days per month, 365.25 days per year) because month lengths vary 28–31.

Reference

Days in each month
MonthCommon yearLeap year
January3131
February2829
March3131
April3030
May3131
June3030
July3131
August3131
September3030
October3131
November3030
December3131
Total365366
Leap years 1900–2100
YearLeap?Reason
1900NoDivisible by 100, not 400
2000YesDivisible by 400
2020YesDivisible by 4
2024YesDivisible by 4
2026NoNot divisible by 4
2028YesDivisible by 4
2100NoDivisible by 100, not 400
Quick reference: common date ranges
SpanCalendar daysBusiness daysWeeks
1 week751.00
2 weeks14102.00
1 month (avg)30.4~224.35
1 quarter~91~6513.0
6 months~182~13026.1
1 common year365~26152.1
1 leap year366~26252.3
10 years~3,653~2,610521.9

Article — Date Difference Calculator

The date difference between two dates is the count of days from one to the other — and the answer depends on whether you include the end date, count weekdays only, or want the result in weeks, months, or years. Between January 1 and January 31 there are 30 days (interval) or 31 days (inclusive). Across a common year there are 365 days; across a leap year, 366. Business days drop those figures by roughly 28%, since weekends remove 2 of every 7 days. This calculator handles all of those at once, using the Julian Day Number algorithm so leap years and century rules never trip the count.

The math behind a date difference looks trivial — surely it is just subtraction? — but real-world day counting has caught out tax authorities, banks, contract lawyers, and even NASA. The variables that bite are leap years on the boundary, the off-by-one between “within” and “through” semantics, and the assumption that a month is a fixed length when it ranges from 28 to 31 days. Get any of those wrong and a 30-day notice can become 29 or 31; a quarterly interest accrual can shift by hundreds of dollars.

Date difference in plain numbers

The headline number is straightforward when both dates sit inside the same year. June 1 to August 1 is 61 days. The arithmetic is just summing month lengths: June (30) + July (31) = 61. When the range crosses a year boundary the count needs to know whether either year is a leap year, because February holds either 28 or 29 days. The difference between December 1, 2023 and December 1, 2024 is exactly 366 days, because 2024 is a leap year and February 29 sits inside the range.

Most date difference questions reduce to one of five forms. How many days between dates — calendar days, the default. How many business days — Monday through Friday only. How many weeks — total days divided by seven. How many months — total days divided by the Gregorian average of 30.4369 days per month. And how many years — total days divided by 365.25, the average year length over the 400-year Gregorian cycle. Each answer is derived from the same total-days figure.

Did you know

October 4, 1582 was followed directly by October 15, 1582 in countries that adopted the Gregorian calendar reform. Ten calendar days simply vanished from history. The U.S. Naval Observatory and most date-difference tools handle this by using a proleptic Gregorian calendar — extending the Gregorian rules backwards as if they had always applied — which keeps the math consistent but does not match what people actually wrote in their diaries.

How the date difference calculation works

The cleanest way to find a date difference is the Julian Day Number method. Each Gregorian date converts to a continuous integer counting days since November 24, 4714 BC in the proleptic Gregorian calendar. Subtract two Julian Day Numbers and you get the day count directly — no month-length tables, no leap-year branching, no edge cases at year boundaries.

The Julian Day Number formula is a piece of late-19th-century cleverness. It packs the leap-year corrections (every 4, except every 100, except every 400) into three floor-divisions: Y/4 adds the leap year for every fourth year, Y/100 subtracts the century skip, and Y/400 adds back the 400-year override. The constants 32045 and 4800 anchor the count to the right epoch. The full formula appears in U.S. Naval Observatory tables and in NASA technical references for astronomical date conversion.

  • 1 day — 86,400 seconds, the fundamental unit
  • 1 week — 7 days, exact
  • 1 month (average) — 30.4369 days, the Gregorian mean
  • 1 common year — 365 days, three out of every four
  • 1 leap year — 366 days, the fourth year (with exceptions)
  • 1 Gregorian year (average) — 365.2425 days; 365.25 is the commonly used approximation

Date difference for business days

Business days strip weekends from the count: only Monday through Friday count. For a span of N calendar days, the business-day count is roughly N times five-sevenths, but the exact figure depends on which weekdays the range starts and ends on. A 14-day span starting on Monday hits two complete weeks of work plus the Monday and Friday of partial weeks — 10 business days. The same 14-day span starting on Saturday picks up 10 business days too, but starting on Sunday it picks up only 10 days as well; the boundary effects cancel within a full week.

Where it gets interesting is partial weeks. A 3-day range starting on Friday gives only 1 business day (Friday alone — Saturday and Sunday do not count). The same range starting on Wednesday gives 3 business days. This calculator iterates through the range day by day and checks each weekday rather than using a closed-form formula, so the count is always correct regardless of which day of the week the range starts.

Business days do not subtract public holidays

U.S. federal holidays differ from UK bank holidays, German Feiertage, and Japanese 祝日 — even the dates that look the same (Christmas, New Year) often shift to the nearest weekday under different rules. This calculator counts Monday through Friday only. If you need a strict working-day figure for a specific jurisdiction, subtract the relevant holiday count by hand. The U.S. Office of Personnel Management lists federal holidays at opm.gov for U.S. calculations.

Leap years and the date difference

Leap years are the single biggest source of small errors in date-difference calculations done by hand. The rule is well known: a year divisible by 4 is a leap year. The two exceptions trip people up. A year divisible by 100 is not a leap year — unless it is also divisible by 400, in which case it is. So 1900 was not a leap year, but 2000 was. The next century-exception year is 2100, which will not be a leap year despite being divisible by 4.

The exact average year length in the Gregorian calendar is 365.2425 days — 365 + 97/400 — because there are 97 leap years in every 400-year cycle (100 years divisible by 4, minus 3 century exceptions, plus 1 added back for the 400-divisible exception). The simpler approximation of 365.25 used in most quick math is off by 0.0075 days per year, about 26 seconds — close enough for converting day spans to years but not for astronomical work.

Did you know

The Julian calendar averaged 365.25 days per year exactly. The 0.0075-day annual overshoot meant the calendar drifted by about three days every 400 years — by 1582, the spring equinox had slipped from March 21 to March 11. The Gregorian reform restored the equinox to March 21 and prevented future drift by adding the century-exception rules. That is why the calendar reform skipped 10 days in October 1582.

Date difference in contracts and law

Contracts treat date differences in surprisingly varied ways. A “30-day notice” usually means 30 calendar days, but some jurisdictions require business days or working days, and some count from the day after notice is given (excluding the start date) while others count inclusively. The U.S. Federal Rules of Civil Procedure Rule 6 specifies that the start day is excluded and the last day is included, with the period extending to the next non-weekend non-holiday day if it falls on a weekend. UK and German civil procedure rules use similar but not identical conventions.

Bank interest accrual is another minefield. The U.S. mortgage convention typically uses actual/365 for interest calculations, while some European bond markets use 30/360, where every month is treated as exactly 30 days. A 30/360 month from January 31 to March 1 might count as 30 days, 31 days, or 28 days depending on the specific convention variant. Always confirm the day-count convention before estimating interest.

  • Actual/365 — uses real calendar days, ignores leap; common in U.S. mortgages
  • Actual/Actual — uses real days for both numerator and denominator; common in U.S. Treasuries
  • 30/360 — treats every month as 30 days; common in European corporate bonds
  • Working days — Mon–Fri minus public holidays; common in employment and contract law
  • Business days — Mon–Fri without holiday adjustment; common in informal contracts

Common date difference pitfalls

The off-by-one error in inclusive ranges

The most common mistake is forgetting whether to count the start day, the end day, both, or neither. Hotel nights count interval only (check-in to check-out for 3 days is 2 nights). Sentence durations count inclusively in U.S. criminal law (a 30-day sentence served from June 1 is over on June 30, not July 1). Contract notice periods vary by jurisdiction. Always state the convention explicitly when communicating a duration.

Timezone-induced day shifts

A meeting at 11 PM New York time on December 31 is already January 1 in Berlin. If the start and end of a duration are recorded in different time zones, a date difference computed from the dates alone can be off by a day. For dates spanning international travel or international contract execution, anchor both timestamps to UTC or to a single reference zone before computing the difference.

Assuming a month is 30 days

February is 28 or 29 days; April, June, September, November are 30; the rest are 31. The Gregorian average is 30.4369 days. Approximating “3 months from January 31” as 90 days lands you on May 1, but the calendar date 3 months later is April 30 or May 1 depending on whether you preserve day-of-month or roll forward. Excel’s EDATE function and most calendar libraries return April 30 (preserving end-of-month).

Pre-1582 dates and historical records

Dates before October 15, 1582 in Catholic countries (and as late as 1918 in Russia) were recorded in the Julian calendar, which by 1900 was 13 days behind the Gregorian. This calculator uses proleptic Gregorian, treating dates before 1582 as if Gregorian rules always applied. For historical research, you may need to convert recorded Julian dates to Gregorian before computing the modern day count.

FAQ

Subtract the earlier date from the later one. For dates inside the same year, sum the days in the months that fall between them. For dates crossing a year boundary, account for any February 29 (leap year) that falls in the range. The calculator does this automatically using the Julian Day Number algorithm.
It depends on the use case. Hotel nights, leases, and most interval durations exclude the end date (check-in June 1, check-out June 4 = 3 nights). Contract notice periods and sentence durations often include both endpoints. The calculator has a toggle for this; check your contract wording.
It uses the full Gregorian rule. A year is a leap year if divisible by 400, or if divisible by 4 but not 100. So 2000 and 2024 are leap years; 1900 and 2100 are not. The Julian Day Number formula bakes these rules into the arithmetic, so February 29 is automatically counted only when it actually exists.
Monday through Friday. The calculator does not subtract public holidays because they vary by country, region, and year. For a strict working-day count in a specific jurisdiction, subtract the relevant national and regional holidays manually. The U.S. has 11 federal holidays; the UK has 8 bank holidays in England and Wales; Germany has 9 to 13 depending on the state.
Months range from 28 to 31 days. There is no single “number of days in a month” that works for all conversions. The calculator uses the Gregorian average of 30.4369 days per month (the mean over the full 400-year cycle). The result is correct on average but can be off by up to a day for any specific span of a few months.
From January 1 of year 1 to December 31 of year 9999. The Julian Day Number algorithm handles any Gregorian date in that range. Dates before the actual 1582 Gregorian reform are computed proleptically — as if the Gregorian rules had always been in force.
Weekday information is useful for planning meetings, checking when a deadline falls, and confirming that a recorded date matches the historical day of the week. The calculator uses the Julian Day Number directly: JDN modulo 7 gives the weekday, with JDN 0 being a Monday in the proleptic Gregorian calendar.
The calculator works only with dates, not times. If you need the duration between two timestamps in different time zones, convert both to a single reference zone (typically UTC) first, then compare the dates. A meeting at 11 PM New York time on December 31 is already January 1 in Berlin, so naively comparing local dates would lose a day.
For calendar days the two agree exactly: both use proleptic Gregorian arithmetic. For business days, Excel’s NETWORKDAYS function takes an optional holiday list this calculator does not. For months, Excel’s DATEDIF with “m” returns whole months between dates and may differ slightly from this calculator’s decimal-month approximation.
It varies. U.S. Federal Rules of Civil Procedure exclude the first day and include the last; weekend deadlines roll to the next business day. UK civil rules use similar “clear days” conventions. Bank interest uses actual/365, actual/actual, or 30/360 depending on the instrument. Always check the specific day-count convention in your contract before computing a deadline or accrual.