Months Between Dates Calculator

Find the number of months between any two dates.

Time & Date Decimal months Leap-safe
Rate this calculator · 5.0 (1)

Months between dates

Calendar months + remaining days · leap-year safe

Instructions — Months Between Dates Calculator

1

Pick a start and end date

Type two dates or use the picker. The earlier date goes in the start field. If you flip them, the calculator notes the reversal and returns a positive count.

2

Choose inclusive or exclusive

Inclusive counts the end date as part of the span. Exclusive does not. The choice changes the total day count by one and may shift the “months + days” result.

3

Read the breakdown

The headline shows full months plus extra days. Below: decimal months, years and months, total days, and weeks. Use whichever format fits your purpose.

Calendar method: month difference is based on calendar months, not 30-day blocks. Jan 15 to Apr 15 is exactly 3 months.
Decimal method: total days divided by 30.4375 (the average month length in the Gregorian calendar).

Formulas

Two methods coexist for month counting. The calendar method tracks month anniversaries. The decimal method converts the total day span into average months.

Calendar months
$$ M = 12(Y_2 - Y_1) + (m_2 - m_1) + \delta $$
$\delta = -1$ if the day-of-month in the end date is earlier than the start day, otherwise $0$. This gives whole months from anniversary to anniversary.
Remaining days
$$ d = \begin{cases} d_2 - d_1 & \text{if } d_2 \geq d_1 \\ d_2 + L - d_1 & \text{otherwise} \end{cases} $$
$L$ is the number of days in the previous calendar month relative to the end date. The result reads as “X months Y days.”
Decimal months
$$ M_{dec} = \frac{D}{30.4375} $$
Average month length is 365.25 / 12 = 30.4375 days. Useful for amortisation, scientific intervals, and durations that span fractions of months.
Total days
$$ D = \left\lfloor \frac{t_2 - t_1}{86400000} \right\rfloor + i $$
Millisecond difference divided by the milliseconds in a day. Add 1 for inclusive counting.
Years and months
$$ Y = \left\lfloor M / 12 \right\rfloor,\quad m = M \bmod 12 $$
Split the full-month count into years and leftover months. A 14-month span reads as 1 year 2 months.
Leap year rule
$$ \text{leap}(y) = (y \bmod 4 = 0) \land \neg(y \bmod 100 = 0 \land y \bmod 400 \neq 0) $$
February 29 only exists in leap years. The calendar method handles this; only inclusive day counts shift by 1 across a leap day.

Reference

Common date spans
StartEndMonthsDays
Jan 1, 2025Apr 1, 2025390
Jan 15, 2024Jan 15, 202512366
Jan 31, 2025Feb 28, 2025028
Mar 1, 2025Sep 1, 20256184
Jun 1, 2024Jun 1, 202624730
Dec 25, 2024Dec 25, 2029601826

Months between dates use cases

Calendar months align with how leases, employment, and loans usually count time.

Loan terms
TermMonths
1 year auto12
3 year auto36
5 year auto60
15 year mortgage180
30 year mortgage360
Common spans
PeriodMonths
Probation3-6
FMLA leave (US)3
Pregnancy9
Quarter3
Fiscal half-year6

Article — Months Between Dates Calculator

Months between dates explained

The number of months between two dates depends on how a month is defined. Calendar months count anniversaries: Jan 15 to Apr 15 is exactly 3 months. Decimal months divide the total day span by 30.4375, the average Gregorian month length, which gives 89 / 30.4375 = 2.92 for the same range.

Both answers are correct for different jobs. Pediatricians, lenders, and HR departments use calendar months. Engineers running amortisation tables, scientists logging durations, and anyone comparing intervals shorter than a month tend to use decimal months. The calculator above returns both.

What months between dates means

Three quantities matter in a date difference: the year change, the month change, and the day change. A standard calendar month difference is twelve times the year change plus the month change, with a correction if the end day of the month is earlier than the start day. That correction shifts the count down by one and rolls the remainder into the days field.

An example: from March 5, 2024 to October 18, 2025. Years differ by 1, months by 7, days by 13. No correction needed (18 is later than 5). Twelve times 1 plus 7 is 19 months. So the answer is 19 months and 13 days. The total day span is 593 days, which gives 19.48 decimal months.

Did you know

The Gregorian calendar averages 365.2425 days per year, or 30.43687 days per month. The 30.4375 figure used in decimal-month conversion comes from the simpler Julian average of 365.25 / 12, which differs by less than two minutes per year.

Calendar vs decimal months between dates

Pick the method that matches the source of the time span. Calendar months win when the dates correspond to events recurring monthly: rent due, loan payment, subscription renewal. Decimal months win when the dates are arbitrary measurements: the start and end of an experiment, a project milestone window, a clinical observation period.

Months between dates shorthand
M_cal = 12ΔY + Δm + δ
M_dec = total days / 30.4375
30 days = 0.99 months
365 days = 12.00 months

Leap years and months between dates

Leap years add February 29. The calendar-month method does not care: Jan 15, 2024 to Jan 15, 2025 is 12 months whether or not Feb 29 falls in the range. Day totals do shift by 1 across a leap day, so the decimal months figure carries an extra ~0.033 (one day divided by 30.4375).

The leap year rule is divisible by 4, except divisible by 100 unless also divisible by 400. So 2000 was a leap year, 1900 was not, 2100 will not be. The calculator handles this in the date library; you do not need to track the rule yourself.

Months between dates in pregnancy tracking

Obstetricians count from the first day of the last menstrual period (LMP) and use weeks rather than months. A 40-week pregnancy works out to 280 days, or 9.20 decimal months. In calendar terms, that is 9 months and roughly 6 days, which is why people say “9 months pregnant” even though the medical metric is weeks.

Tip

For trimester planning, use weeks (LMP + 280 days = due date). For everyday talk and most apps, calendar months still work fine. Just remember that “3 months pregnant” corresponds to roughly weeks 9-13.

Months between dates for loans and leases

Loans, leases, and subscriptions almost always count in calendar months. A 60-month auto loan signed on June 30 ends on June 30 five years later. A 12-month lease starting January 15 ends on January 15. Day adjustments happen only at the boundaries, when contracts begin or end mid-month and pro-rate the first or last payment.

For amortisation arithmetic, the monthly interest rate is the annual rate divided by 12. That uses the same convention: a year is 12 calendar months, regardless of leap days. Some bond and money-market instruments use day-count conventions like Actual/360 or Actual/365, but those are interest calculations, not month counts.

Months between dates for age in months

Pediatricians track age in months from birth up to age 2 or 3. The same calendar-month rule applies: a baby born March 20 turns 1 month old on April 20, 2 months on May 20, and so on. If the current day is earlier than the birth day, subtract one from the count. So on May 19, a child born March 20 is 1 month old, not 2.

Adjusted age for preemies

For babies born before 37 weeks, pediatricians often use adjusted age (chronological age minus weeks of prematurity) for developmental milestones. Adjusted age is used until around age 2 or 3, then dropped.

Common pitfalls in counting months

Three issues catch people out. First, treating a month as 30 days: it is not, and decimal conversion needs 30.4375 to be accurate. Second, ignoring the day-of-month adjustment: Jan 31 to Feb 28 is 0 months 28 days, not 1 month. Third, mixing methods within one calculation: never compute calendar months and then add decimal-month remainders, because the denominators differ.

  • 30.4375 = average month length in days (Julian)
  • 30.43687 = average month length in days (Gregorian)
  • 12 months in every year, no exceptions
  • 365 or 366 days per year depending on leap status
  • 0 month difference for any span shorter than the next calendar anniversary
  • 280 days = roughly 9 calendar months (pregnancy from LMP)
  • 360 months = standard 30-year mortgage term

Worked examples

Three examples worth walking through. First, June 1 to June 1 next year: 12 months, 365 or 366 days depending on year. Second, March 31 to April 30: end day (30) earlier than start day (31), so calendar months = 0 and days = 30. Third, January 15, 2023 to July 4, 2025: years differ by 2, months by 6, days by -11. Apply correction: 30 months minus 1 = 29 months, with leftover days computed against June’s 30 days = 19 days. So 29 months 19 days, or 901 total days, or 29.60 decimal months.

For most everyday uses, the calendar-month answer is the one to quote. For statistical comparisons across many intervals, the decimal version is more honest because it preserves the precise day count and does not collapse short overhang periods. The calculator displays both side by side so you can pick the one that matches your context without doing the arithmetic yourself.

Crossing a year boundary is the same arithmetic. December 15 to February 1 is 1 month 17 days: month delta is -10 (12 to 2), year delta is 1, so 12 minus 10 is 2 months, then correction (1 is earlier than 15) takes it down to 1, with 17 leftover days. The total day span is 48 days, or 1.58 decimal months.

FAQ

4 months exactly. The day-of-month matches, so there are no extra days. In decimal months, that is 4.00.
Calendar months count anniversaries: Jan 15 to Apr 15 is 3 months. Decimal months divide the total day span by 30.4375, the average Gregorian month length. The two methods give slightly different answers when remainders are involved.
Calendar month differences ignore leap days, so Jan 15, 2024 to Jan 15, 2025 is still 12 months even though 2024 was a leap year. Total day counts include Feb 29 if it falls in the range. Inclusive counting adds 1 to the day total.
It means 3 full calendar months have elapsed (anniversary to anniversary) and 14 extra days remain after the last month boundary. The decimal version of 3 months 14 days is 3.46 months (using 30.4375 average days).
A month is not a fixed number of days. Jan 31 to Feb 28 is 0 months 28 days, not 1 month, because the start day (31) is later than the end day (28). The calculator subtracts 1 month when the end day is earlier than the start day.
Put the birth date as start and today as end. Read the months value. For children under 2, pediatricians use this exact figure for developmental milestones. Decimal months (1.5 = 1 month 2 weeks) work too.
280 days = 9.20 decimal months. That is the standard length of pregnancy measured from the last menstrual period (LMP). In calendar months it works out to roughly 9 months and 6 days.
12 months in any year. The total days vary: 365 in common years, 366 in leap years. Calendar month spans stay constant; day-level spans shift across leap years.
Inclusive counting includes the end date in the total, exclusive does not. Use inclusive for paid leave or contract durations where the last day counts. Use exclusive for waiting periods that end the morning after.
Calendar months are exact. Decimal months use a 30.4375-day average, so they carry a small bias for any individual range. For loan amortisation and HR records, the calendar method is the standard.