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.
Y = end.year - start.year borrow 12 if M negativeM = end.month - start.month borrow daysInPrevMonth if D negativeD = end.day - start.day after borrow this is the remaindertotalMonths = 12Y + M the headline numberHow 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.
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.
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.
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.
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.