Date Difference Calculator

Measure the gap between two dates both ways at once — as calendar years, months and days, and as an exact count of days, weeks and hours — with the end date counted or not, as you choose.

Updated August 2026 Education, Time & Everyday

Pick two dates

How to count
Difference
Total days
Total weeks
Total months
Weekdays in the gap

Dates are counted in UTC. Every calculation here anchors dates at midnight UTC, so a day is exactly 24 hours and daylight saving cannot shift a result by an hour. Time zones, local holidays and contractual definitions of a working day vary, so check the answer against the rules that actually govern your situation.

How to Use the Date Difference Calculator

The gap between two dates has two honest answers and people argue about them constantly. As calendar units it is a number of years, months and days; as a flat count it is a number of days. Neither is wrong, they measure different things, and this page gives you both rather than picking one.

  1. Enter both dates. Order does not matter — if the end date comes first, the calculator swaps them and says so, rather than returning a negative number nobody wanted.
  2. Choose how to count. Excluding the end date measures the gap between two moments. Including it counts how many days the range spans, which is what a hotel stay or a contract period usually means.
  3. Read the calendar figure for anything conversational — two years and five months is how a person describes a gap.
  4. Read the day count for anything precise. It is exact, it sorts and compares cleanly, and it does not depend on any convention about how long a month is.

All dates are handled at midnight UTC, so a day is always exactly 24 hours and no daylight saving change can shift the answer. Nothing you enter leaves your browser.

Date Difference Formulas

The day count is a subtraction. The calendar breakdown is a procedure, and the order of its steps is what makes it correct.

Total days = (end − start) ÷ 86,400,000 millisecondsyears = whole years from start to endanniversary = start advanced by (years × 12) monthsmonths = whole months from the anniversary that still fitdays = remaining days after that markerInclusive counting adds one day, turning a half-open interval into a closed one. Decimal years use the 365.2425-day mean Gregorian year.
What each symbol means
SymbolMeaningUnitTypical range
total daysExact whole days between the two datesdays0 to 40,000
yearsComplete years the gap containsyears0 to 100
monthsComplete months after the last whole yearmonths0 to 11
weekdaysMonday to Friday within the rangedays0 to 30,000

The reason years come first is that the answer would otherwise be ambiguous. Extracting months before years, or days before months, produces different and equally defensible results, which is why two date calculators can disagree about the same pair of dates and neither be broken.

The inclusive option is the single biggest source of disagreement about date ranges. From the 1st to the 8th is seven days apart and spans eight days. A landlord charging for eight nights and a tenant counting seven are both counting correctly and will still argue.

Example

Worked example one: 15 March 2024 to 28 August 2026. Whole years first: 2026 − 2024 = 2, and 15 March has passed in 2026, so it is 2 years, taking us to 15 March 2026.

From there, five whole months fit before we pass 28 August — reaching 15 August 2026 — so 5 months. From 15 August to 28 August is 13 days. The calendar answer is 2 years, 5 months and 13 days, or 29 months and 13 days.

The flat count is 896 days, and it produces a small piece of luck: 896 ÷ 7 is exactly 128 weeks, with no remainder. That happens whenever both dates fall on the same weekday, and here both are Fridays. Counted inclusively the range spans 897 days.

Worked example two: when the average month is safe to use. The 29 whole months in this span run from 15 March 2024 to 15 August 2026 and contain 883 days. Of those months, seventeen are 31 days, ten are 30 and two are 28-day Februarys — 2025 and 2026, neither of them a leap year.

An average month of 30.436875 days would estimate 29 × 30.436875 = 882.67 days against the true 883, which is a third of a day out across two and a half years. Over a long span the long and short months balance, so the average works. Divide the full 896 days by 365.2425 and you get 2.4532 years, which is reliable for the same reason.

Over a short span it fails badly. From 1 January to 1 March 2026 is exactly 59 days, where two average months would suggest 60.87 — nearly two days out on a two-month gap. From 1 July to 1 September is 62 days, more than a day over. The average month is a long-run figure, and a month is not a unit of duration.

The same gap, measured six ways
MeasureValueNote
Years, months, days2 y 5 m 13 dHow a person would say it
Total months29 monthsPlus 13 days
Total weeks128 weeksExactly — both dates are Fridays
Total days896 daysEnd date not counted
Total days, inclusive897 daysBoth ends counted
Decimal years2.4532 yearsUsing the 365.2425-day mean year

Which Measure Do You Actually Want?

Pick your measure by what the number is for. A day count is right for anything that will be compared, sorted, charged per day or fed into another calculation. The calendar breakdown is right for anything a person will read, because nobody describes a gap as 896 days.

The inclusive switch deserves a deliberate decision rather than a default. Notice periods, rental agreements, hospital stays, holiday allowances and prison sentences all have conventions about whether the last day counts, and those conventions are written into the relevant rules rather than being a matter of arithmetic.

The weekday count is useful for a rough working-day figure, but it deducts no holidays. For anything contractual, the days between dates calculator takes a list of holidays and removes the ones that fall on working days.

Where the two dates land on the same weekday, the week count comes out whole — as it does here at exactly 128. It is a satisfying check on your inputs: if you expected a whole number of weeks and got a remainder, one of the dates is probably wrong.

For a gap that starts at a birth date, the age calculator runs the same arithmetic and adds a birthday countdown, which is usually what is actually wanted.

Five Reasons Two Tools Disagree

Five things that make two date calculators disagree.

Extraction order. Taking years, then months, then days is the common convention, but extracting the largest unit last gives different results. Both are internally consistent, which is why the same pair of dates can legitimately produce 2 y 5 m 13 d in one tool and something slightly different in another.

Inclusive or exclusive. The single most common source of off-by-one disagreements, and the reason contracts say things like 'both dates inclusive' in writing. Neither reading is wrong in the abstract.

Time zones. A tool working in local time will disagree with one working in UTC whenever a date sits near midnight, and a tool working in local time across a daylight saving boundary can produce a 23- or 25-hour 'day'. Everything here is UTC for exactly that reason.

The average year. Decimal years can use 365, 365.25 or 365.2425 days, and the third is the correct Gregorian mean. Over a long span the difference between them is visible: across a century, 365.25 overstates by about three quarters of a day.

Month-end clamping. Adding a month to 31 January has no single right answer. Clamping to the end of February is the least surprising choice; rolling into March is what naive code does, and it shifts every subsequent step by a day or three.

Frequently Asked Questions

Subtract one from the other. From 15 March 2024 to 28 August 2026 is 896 days exclusive of the end date, or 897 counting both ends.

Because they measure different things. Two years and five months is how a person describes the gap; 896 days is the exact count. Months are not a fixed length, so the two do not convert into each other.

It depends what you are measuring. Excluding it gives the gap between two moments; including it gives the number of days the range spans, which is what a hotel stay or a notice period usually means.

You cannot do it exactly. Twenty-nine calendar months here contain 896 days, while 29 average months of 30.44 days would suggest 883 — the actual months you crossed decide the answer.

The calculator swaps them and says so in the note, rather than returning a negative figure. The magnitude of the gap is the same either way.

Divide the day count by seven. Here 896 ÷ 7 is exactly 128 weeks, which happens because both dates fall on a Friday.

It shows how many Monday-to-Friday days fall in the range, but deducts no holidays. For a contractual working-day count, use the days between dates calculator, which takes a holiday list.

The day count divided by the 365.2425-day mean Gregorian year. Here 896 days is 2.4532 years. It is useful for interest and actuarial work and it is not how anyone states a duration in conversation.

Because a day in UTC is always exactly 24 hours. Working in local time means a day can be 23 or 25 hours across a daylight saving change, which quietly breaks date arithmetic twice a year.

Yes, and the arithmetic is exact under the Gregorian calendar. Be careful with dates before the Gregorian changeover, though — different countries switched in different years and skipped ten or eleven days when they did.