Month Counter Calculator

Count the exact number of full months between any two dates, with a year-month-day breakdown plus decimal months, total weeks, and total days.

Time & Date Leap year aware Inclusive option
Rate this calculator · 5.0 (3)

Months between two dates

Full months + remaining days · year/month/day breakdown · inclusive option

Instructions — Month Counter Calculator

1

Enter your two dates

The month counter loads with a default 18-month span ending today, so you get an immediate working number on first load. Type any start and end date and the result updates as you type. Reverse order is fine; the calculator detects which date is later and swaps internally.

2

Pick inclusive or exclusive

Exclusive (the default) does not count the end date itself, which matches most lease and contract language. Inclusive adds one day, which is what you want for tenancy days, residency counts, or any "through" deadline. The month counter applies the toggle before computing the year-month-day breakdown.

3

Read the breakdown

The headline is the total number of full calendar months. Below that you get the same span expressed as years, months, and days, plus decimal months (handy for prorated billing), total weeks plus extra days, and total calendar days. Use the span quick-picks to jump to common ranges like 6 months or 2 years.

End-of-month dates: the month counter treats January 31 to February 28 as exactly one month, because the calendar runs from end of January to end of February. This matches Excel DATEDIF behavior.
Decimal months: the result uses 30.4375 days per month, which is the average length of a Gregorian month (365.25 / 12). Useful for finance and prorated calculations.

Formulas

Counting months looks like simple subtraction but needs careful borrowing when the end date is earlier in the month than the start. Below are the exact formulas the calculator runs, plus the calendar identities behind the decimal month conversion.

Year-month-day difference
$$ \Delta = Y\text{y}, \; M\text{m}, \; D\text{d} $$
Subtract year-on-year, month-on-month, day-on-day. Borrow from the previous month if the day difference goes negative, then borrow from the year if months go negative.
Day borrow
$$ \text{if } D_e < D_s: \; D = D_e - D_s + d_{prev}, \; M{-}{=}1 $$
Add the number of days in the month preceding the end month. January 20 to March 5 borrows 28 days (February in a non-leap year) or 29 days in a leap year.
Month borrow
$$ \text{if } M < 0: \; M = M + 12, \; Y{-}{=}1 $$
A negative month difference means the end date falls earlier in its year than the start date. Subtract one year and add twelve months to fix the sign.
Total months
$$ M_{total} = 12Y + M $$
After borrowing settles the years and months, multiply years by 12 and add the leftover months. This is the headline figure on the calculator.
Decimal months
$$ M_d = \frac{\Delta d}{30.4375} $$
The Gregorian year averages 365.25 days, so the average month is 30.4375 days. Decimal months are useful when you need a single number for prorated rent or finance.
30/360 alternative
$$ M_{30/360} = \frac{360 \Delta y + 30 \Delta m + \Delta d}{30} $$
US bond and mortgage convention. Treats every month as 30 days and every year as 360 days. Faster to compute but loses a few days a year against the calendar.

Reference

Where a month counter matters
ContextWhat to computeNotes
Apartment leaseFull months between move-in and move-outMost US leases are 12-month; partial months prorated by day count
Mortgage termTotal monthly payments30-year mortgage = 360 payments; 15-year = 180 payments
Auto leaseMonths remaining36 or 39 months is the typical US lease term
Baby ageMonths and days from date of birthPediatric milestones tracked monthly until 24 months
Probation periodMonths from start of employment90 days = 3 months is common; some plans use exact 90 days
Subscription billingMonths elapsed for prorated refundUse decimal months for partial-month refund
Statute of limitationsMonths between event and filingSeveral US torts have 12 or 24 month limits
Vesting cliffMonths until cliff4-year vesting with 12-month cliff = 25% vests at month 12

Month length quick reference

The month counter borrows day counts from this table when day arithmetic goes negative. February has 28 days in a common year and 29 in a leap year.

Days per month
MonthDays
January31
February28 or 29
March31
April30
May31
June30
July31
August31
September30
October31
November30
December31
Common month spans
SpanDays (approx)
1 month28 to 31
3 months89 to 92
6 months181 to 184
12 months (1 year)365 or 366
24 months (2 years)730 or 731
36 months (lease)1,095 or 1,096
60 months (5 years)1,826 or 1,827
180 months (15 years)5,478 or 5,479
360 months (30 years)10,957 or 10,958

Note: the month counter uses the calendar-anchored definition of a month. So January 31 to February 28 reads as exactly one month, the same way Excel DATEDIF and PHP DateInterval handle it.

Article — Month Counter Calculator

Month counter: how to count full months between any two dates

A month counter returns the exact number of full calendar months between two dates, plus the leftover days. The calendar makes this trickier than it looks: February has 28 or 29 days, four months have 30, the rest have 31, and the borrow rule that handles end-of-month edge cases is not obvious. The calculator above runs the same arithmetic Excel DATEDIF, PHP DateInterval, and most date libraries use, so the answer matches what payroll, leasing, and pediatric software will give you.

The headline result is the number of full months. Below it the calculator shows a year-month-day breakdown, decimal months for prorated calculations, total weeks plus extra days, and total calendar days. Defaults load to an 18-month span ending today, so the first thing you see is a working answer, not blank fields.

What a month counter does

A month counter takes two dates and returns how many full months fit between them, plus the leftover days that did not complete a month. So January 15 2023 to March 20 2025 is 26 full months and 5 days, or equivalently 2 years, 2 months, and 5 days. The full-month count is what leases, loans, and pension schedules care about. The remaining days matter for prorated rent and refunds.

Why not just divide by 30? Because months are not 30 days. They average 30.4375 days across a Gregorian year, but the actual lengths run from 28 to 31. A division-by-30 estimate drifts by several days over a year, which is fine for rough mental math but wrong for a contract. The month counter follows the calendar, advancing one month at a time and checking whether the target day exists in the destination month.

The month counter logic in one line
Y = end.year - start.year borrow 12 if M negative
M = end.month - start.month borrow daysInPrevMonth if D negative
D = end.day - start.day after borrow this is the remainder
totalMonths = 12Y + M the headline number

How the month counter handles end of month

End-of-month dates are where most month counters disagree. January 31 to February 28 is the classic case. Is that one month or zero months? The calendar-anchored convention says one month: end of January to end of February is a full month, because February has no day 29 in a common year and no day 30 or 31. The month counter on this page treats it that way, matching Excel DATEDIF with the YM unit.

The harder case is March 31 to April 30. April only goes to 30, so the calendar reaches the end of April, which the month counter reads as exactly one month. But March 31 to April 29 reads as zero full months and 29 days, because the calendar did not quite reach the same day of the next month. Some payroll systems use a stricter end-of-month rule that would call March 31 to April 30 a full month plus a roll-forward. The calculator on this page uses the more common library convention.

When 30 days is not one month

30 days from January 31 lands on March 2 in a common year and March 1 in a leap year. One month from January 31 is February 28 or 29. A lease clause that says "within 30 days" is not the same as one that says "within one month". The first is a fixed day count; the second varies by two or three days depending on which month you start in. The month counter shows both so you can compare.

Month counter vs day counter

A day counter gives a single fixed number: 1,000 days is 1,000 days no matter when you start. A month counter gives a number that depends on the months in the span. Three months is 89 to 92 days depending on which months you pick. The month counter reconciles the two by showing both: total months as the headline, total days as a separate cell, and decimal months for the in-between cases.

Decimal months come from dividing total days by 30.4375, which is the average month length over a 400-year Gregorian cycle. So a span of 100 days reads as 3.29 decimal months. Useful when you need a single number for finance, but slightly off the calendar count if you also look at full months and remaining days.

Did you know

The Roman calendar attributed to Romulus had ten months starting in March. January and February did not exist. That is why September, October, November, and December still mean seventh, eighth, ninth, and tenth in Latin, despite being the ninth through twelfth months. Numa Pompilius added January and February around 713 BC, and Pope Gregory XIII set the modern leap-year rule in 1582.

Leap years and the month counter

Leap years affect the day borrow in the month counter, not the month count itself. A leap year is divisible by 4, except for years divisible by 100 that are not also divisible by 400. So 2000 was a leap year, 1900 was not, 2024 is, 2100 will not be.

For the month counter, leap years matter when the end date is in March and the start date is in January or February. January 20 2024 to March 5 2024 borrows 29 days from the preceding February (2024 is a leap year), giving 1 month and 14 days. The same span one year later borrows 28 days but gives 1 month and 13 days.

  • Gregorian year = 365.2425 days on average
  • Average month = 30.4375 days
  • 400-year cycle = 146,097 days, 97 leap years
  • Common year = 365 days (303 of every 400)
  • Leap year = 366 days (97 of every 400)
  • Shortest month = February with 28 days
  • Longest months = January, March, May, July, August, October, December with 31

Using a month counter for leases

Leases are where the month counter earns its keep. A 12-month lease starting March 1 ends February 28 or 29 next year, depending on the leap year, and counts as exactly 12 months. A lease starting March 15 and ending August 31 is 5 months and 16 days, or roughly 5.55 decimal months for prorated calculations. Most landlords prorate the partial month by dividing rent by the days in the actual month, which is why decimal months can mislead.

Commercial leases often use month-and-day language for renewal options: "notice no later than 60 days before lease expiration" needs both a month counter and a day counter to evaluate. The calculator above provides both readings from the same input.

Tip

When using the month counter for legal deadlines, read the contract carefully for whether months are calendar months or 30-day periods. The two differ by a few days each. If the contract is silent, courts in most US jurisdictions default to calendar months unless the context strongly suggests otherwise. The month counter on this page uses calendar months; switch to a day counter for 30-day or 90-day notice periods.

Month counter for baby age

Pediatric practice tracks infant age in months until two years, then in years and months until five. A baby born April 15 2024 is 12 months and 28 days old on May 13 2025, which pediatricians round to 13 months for milestone tracking. The month counter does this calculation directly: enter the date of birth and today, read the year-month-day breakdown.

30/360 finance convention

Finance uses a different month counter for bonds and some mortgages: the 30/360 convention treats every month as 30 days and every year as 360 days. A 6-month period is always 180 days. Faster to compute, simpler for daily interest accrual, but two to five days short of the actual calendar each year. Municipal bonds and many corporate bonds still use 30/360; US Treasury bonds use actual day counts.

Calendar months
28 to 31 days
used by Excel, libraries, courts
30/360 months
30 days exactly
used in some bond and mortgage math

Common month counter pitfalls

Two pitfalls catch most people new to a month counter. The first is assuming three months equals 90 days. It does in winter (December plus January plus February in a non-leap year), but not in summer (June plus July plus August is 92 days). The second is the end-of-month wrap. February 28 to March 31 is one month and three days, but February 28 to March 28 is exactly one month and zero days.

A third pitfall is the inclusive vs exclusive question. With the same start and end date, exclusive mode gives zero days; inclusive gives one. For contracts, exclusive is standard. For hotel stays and residency days, inclusive is what you want.

FAQ

The calculator subtracts year from year, then month from month, then day from day. If the day difference is negative, it borrows the day count of the month preceding the end month and decrements the month difference. If months go negative, it borrows 12 from years. Then it multiplies years by 12 and adds leftover months to get the total. So January 15 2023 to March 20 2025 reads as 2 years, 2 months, 5 days, or 26 total months.
No, the month counter treats 31 March to 30 April as zero full months and 30 days, because April only has 30 days and the calendar does not reach April 31. Switch the start to 31 March and end to 1 May and you get exactly one month and zero days. This matches Excel DATEDIF and most date libraries. The 30/360 finance convention would give one month, but the calendar convention is the default.
Between 2.93 and 3.04 months, depending on which months the span covers. December plus January plus February in a non-leap year is 90 days (one month each), but April plus May plus June is 91 days. The month counter shows decimal months using 30.4375 days per month, so 90 days reads as 2.96 decimal months.
From date of birth to the current date, counting full calendar months and remaining days. A baby born April 15 2024 is 12 months and 28 days old on May 13 2025, which most parents round to "just over a year". Pediatricians use months until 24, then switch to years. The same calculation works for puppies, kittens, and any other age in months.
Exclusive mode does not count the end date itself, so March 1 to April 1 reads as one month and zero days. Inclusive mode adds one day, so the same span reads as one month and one day. Most contracts and leases use exclusive counting. Some hotel stays, residency requirements, and tax day counts use inclusive. The calculator does both with a single click.
360 months exactly. Standard US mortgages are quoted in years and amortize monthly, so the total payment count is years times 12. A 15-year mortgage is 180 payments, a 20-year is 240, a 25-year is 300. The month counter handles partial spans for refinancing or prepayment calculations.
30 days from January 31 is March 2 in a non-leap year, March 1 in a leap year. One month from January 31 is February 28 or February 29. A lease that says "within 30 days" is not the same as one that says "within one month". The first is fixed at 30 days; the second varies by two or three days depending on which month you start in.
Yes, the day borrow uses the actual length of the month preceding the end date, including February 29 in leap years. So January 15 2024 to March 1 2024 borrows 29 days because 2024 is a leap year, while January 15 2025 to March 1 2025 borrows 28 days. The calculator detects the leap year using the Gregorian rule (divisible by 4, except centuries not divisible by 400).