TodayFree forever - no sign-up, no paid plans

How to calculate months and years between two dates

Open the Days Between Calculator

Days are the honest unit of elapsed time, but nobody describes a job, a lease or a childhood in days. We say two years and five months. Turning a day count into that human form - or building it directly from two dates - is its own skill, because months refuse to be a fixed size. This guide gives the method professionals use, the anniversary method, and walks through the month-end cases where naive counting falls apart.

The anniversary method, step by step

The method works by stepping forward from the start date on matching day numbers, largest unit first.

  • Whole years: advance from the start date to the same month and day in later years, as many times as you can without passing the end date.
  • Whole months: from that anniversary, advance month by month to the same day number, again stopping before you pass the end date.
  • Remaining days: count the days from the last step to the end date. This remainder is always less than a month.

Worked example: March 15, 2024 to August 20, 2026. Whole years: March 15, 2024 to March 15, 2026 is 2 years. Whole months: March 15 to August 15, 2026 is 5 months. Remaining days: August 15 to August 20 is 5 days. The span reads as 2 years, 5 months and 5 days. For reference, the same span in pure days is 888, which is what the days between calculator reports as its headline figure before breaking it down in exactly this way. The dedicated months between dates calculator shows the whole-months total too: those 2 years and 5 months are 29 whole months, plus the 5 leftover days.

Why you cannot just divide by 30

The tempting shortcut - take the day count and divide by 30, or by the average month of 30.44 days - produces a decimal that looks precise and is quietly wrong for calendar purposes. 888 divided by 30.44 is about 29.2 months, which rounds to the same 29 whole months here, but try it on a span from January 31 to March 1 - 29 real days that the average method reports as about 0.95 of a month, a figure that answers no question anyone was actually asking. Averages are fine for estimates and budgets. For anything with a date attached - an anniversary, an eligibility rule, a contract anniversary - only the real calendar reading counts, because the other party will be using the real calendar.

Calculating months and years between two dates for a long stay booked by the month

The month-end problem

The anniversary method has one genuinely hard corner: start dates on the 29th, 30th or 31st, whose matching day number does not exist in every month. Consider January 31 to February 28. Has a whole month passed? February never offers a 31st to step onto. The reading used by this site, and by spreadsheet DATEDIF in most cases, is 0 whole months and 28 days - the month completes only when the calendar reaches a date at least as far through a month as the start date was. Other systems clamp instead, treating February 28 as the stand-in for the missing 31st and calling it one month.

Neither convention is crazy, but they disagree, and the disagreement lands on real questions: whether a monthly subscription has completed a month, whether a baby is one month old on February 28, whether a tenancy has run a full month. If your span starts on the 29th, 30th or 31st and the answer matters, state the convention you used alongside the answer, the same discipline as naming inclusive or exclusive counting for days. Our guide on how many days are in each month is the reference to keep open while you work through these cases, because every one of them turns on a month length.

Months only, or years and months?

The same span can be reported two ways: 29 months and 5 days, or 2 years, 5 months and 5 days. Choose by audience and by what the number feeds. Ages of children, lengths of service and tenancy durations are conventionally years and months. Loan terms, warranties and subscription ages are often stated in total months, because payments are monthly and the total-months figure multiplies straight into a schedule. Beware one hybrid error: converting 2 years 5 months into "2.5 years." Five months is not half a year; 2 years and 5 months is about 2.42 years. If a decimal year is needed, compute it from days - total days divided by 365.25 - and label it as an approximation.

Checking your reading

Verify a months-and-years reading by rebuilding the day count from it and comparing with a direct count. Take the reading's years and months as calendar steps from the start date, then add the leftover days; you should land exactly on the end date. For the worked example: March 15, 2024 plus 2 years is March 15, 2026; plus 5 months is August 15, 2026; plus 5 days is August 20, 2026 - the end date, confirmed. If your rebuild overshoots, a "whole month" in your reading was not whole. The months between dates calculator performs this reading with the month-end convention stated on the page, so your hand result and the tool can be checked against each other rather than merely compared.

Frequently asked questions

How do I calculate months between two dates?

Use the anniversary method. Count whole years from the start date to its anniversary, then whole months from that anniversary to the same day number in later months, then the remaining days. What is left over is always less than one month, which is what makes the answer a true calendar reading.

Why is my answer not a whole number of months?

Because most spans do not begin and end on the same day of the month. The leftover days after the last whole month are real and belong in the answer: 2 months and 30 days is a complete, correct reading, not an error to be rounded away.

What is the anniversary method?

A way of breaking a span into years, months and days by stepping forward on matching day numbers. A whole year completes when the same month and day come round again; a whole month completes when the same day number comes round in a later month. It mirrors how people naturally state ages and anniversaries.

How do I handle a start date on the 31st?

Carefully, because some months have no 31st. A span from January 31 to February 28 is usually read as 0 whole months and 28 days, since no February date matches the 31st. Conventions differ between systems, so for month-end starts, state the reading you used.

Should I count a span in months or in days?

Use days when precision matters - deadlines, interest, eligibility - because days are unambiguous. Use months and years when you are communicating with people, because that is how humans picture durations. For anything important, give both.

Related guides

How to calculate weeks between two dates - the quick method

Count the days, divide by seven, and read the leftover days honestly.

How many days are in each month - and how to remember them

The full table, the knuckle method and the rhyme.

How to calculate days between two dates by hand

The midnight method and the day-of-year method, with worked examples.

How to calculate your age in days

Your age in days, and your next 1,000-day milestone.

Daniel Mercer

Daniel Mercer builds and maintains the calculators on this site. He spent ten years in payroll and operations roles counting business days, notice periods and deadlines by hand, and writes these guides the way he would explain the count to a colleague - the rule first, a worked example second, and the common mistake called out before it happens.