Months Between Dates Calculator

Counting months between two dates arises constantly in financial and legal contexts. A residential lease runs for a fixed number of months. A loan has a term measured in months. A subscription service renews monthly. An insurance policy has a coverage period expressed in months. A probationary employment period typically lasts 3 or 6 months. In each case, knowing the exact number of complete calendar months and any leftover days is important because months vary in length from 28 to 31 days, meaning a simple division by 30 will give an incorrect answer in many cases. This calculator uses proper calendar month arithmetic: it counts how many complete months have elapsed from the start date, accounting for month-end boundary conditions, then counts the remaining days as the gap between the end of the last complete month and the end date. The start date defaults to today and the end date defaults to 6 months from today, giving you a quick half-year view. Results update as soon as you change either date. For reference, the total day count is also shown so you can cross-check against other tools.

The earlier date
The later date
--
--
--

How months between dates are calculated

The calculator computes a month count based on the difference in calendar years and months, then adjusts if the end day-of-month is before the start day-of-month (meaning the final month is not yet complete). Remaining days are the gap between the end of the last complete month and the actual end date.

months = (endYear - startYear) * 12 + (endMonth - startMonth)
// Check if end day-of-month is before start day-of-month:
startPlusMonths = new Date(startYear, startMonth - 1 + months, startDay)
if (startPlusMonths > endDate) months -= 1
startPlusMonths = recalculate with adjusted months
remainDays = Math.round((endDate - startPlusMonths) / 86400000)
totalDays = Math.round((endDate - startDate) / 86400000)

Worked example

Start: 14 June 2026. End: 20 January 2027.

Year difference: 0. Month difference: 7 (Jan = 1, June = 6, so 1 - 6 + 12 = 7). Check: 14 January 2027 is before 20 January 2027, so the month count stands. Remaining days: 20 - 14 = 6. Result: 7 months and 6 days.

Month counting in financial and legal contexts

Most financial products and legal contracts define duration in calendar months. A 12-month lease starting on 1 July 2026 ends on 30 June 2027. A 30-year mortgage has a term of 360 months. Subscription billing runs from the subscription start date to the same day of the following month. When a contract says "6 months from the date of signing," it means 6 calendar months, not 180 or 183 days. This calculator uses the same calendar-month convention.

Months between dates: frequently asked questions

How are months between dates calculated?

The calculator counts complete calendar months from the start date to the end date. It first calculates the difference in years and months, then checks whether the day of the month in the end date has reached or passed the day of the month in the start date. If it has not, one month is subtracted and the remaining days are counted from the partial month. This matches the convention used in most legal and financial contexts.

Why is the result different from dividing days by 30?

Because calendar months are not 30 days long. January, March, May, July, August, October, and December have 31 days. April, June, September, and November have 30 days. February has 28 days in standard years and 29 days in leap years. Dividing days by 30 will give an approximation that can be off by days or even a full month depending on which months are involved.

How many months are in a year?

There are 12 calendar months in a year: January, February, March, April, May, June, July, August, September, October, November, and December. This is fixed by the Gregorian calendar used internationally. A calendar year has either 365 days (standard year) or 366 days (leap year).

What is a calendar month vs 30 days?

A calendar month is a named month in the Gregorian calendar with a fixed number of days (28, 29, 30, or 31 depending on the month and year). A 30-day period is simply 30 consecutive days, which may span parts of two calendar months. Lease agreements, mortgages, and most legal contracts use calendar months, not 30-day periods, which is why this calculator uses calendar month counting.

Can I use this for loan term calculations?

Yes. Enter the loan start date as the start date and the loan maturity date as the end date. The result gives the loan term in complete calendar months. Most personal loans, auto loans, and mortgages are structured in calendar month terms (for example, 36 months, 60 months, or 360 months). The remaining days output tells you whether the term is an exact number of months or includes a partial month at the end.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 14 June 2026. See our methodology.