# How many months between dates?

Counts the months between two dates: whole months and days, the same span as a decimal number of months, in years, months, and days, and in days.

- Page: https://www.acalculator.org/days/month-calculator
- JSON spec: https://www.acalculator.org/days/month-calculator.json
- Version: 79952b93b02f

## Default answer

Example with the default inputs (Start date March 30, 2026, End date September 30, 2026) on the example date Wednesday, September 30, 2026: From March 30, 2026 to September 30, 2026 is 6 months (6 in decimal months).

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| start | Start date | The earlier date. |
| end | End date | The later date. Today, unless you change it. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| months | Months | Whole calendar months and the days left from the start date to the end date. |
| decimal | In months | Whole months plus the part of the next month that has passed: the days since the last monthly date ÷ the days to the next one. |
| span | In years, months, and days | The same time as whole years, then whole months, then days. |
| days | Days | Calendar days from the start date to the end date. |

## Method

months = the most whole months M with start + M months ≤ end; decimal months = M + (end − (start + M months)) ÷ ((start + (M + 1) months) − (start + M months))

## Assumptions

- Dates are whole calendar days in the Gregorian calendar, with no time of day.
- Adding months keeps the day of the month; a day that the month does not have moves to its last day, so January 31 plus 1 month is February 28 (or 29).
- The end date is today unless you change it; the page reads today’s date from your device when it loads.
- A start date after the end date has no answer.

## Worked examples

1. start = 2026-01-15, end = 2026-09-30 gives months = {"months":8,"days":15}, decimal = 8.5, span = {"years":0,"months":8,"days":15}, days = 258. Source: Julian Day numbers (Meeus, Astronomical Algorithms, 1991, chapter 7): JD 2461313.5 − JD 2461055.5 = 258 days.
2. start = 2026-01-31, end = 2026-03-15 gives months = {"months":1,"days":15}, decimal = 1.483871, days = 43. Source: Gregorian calendar month lengths (ISO 8601).
3. start = 2025-11-30, end = 2026-02-28 gives months = {"months":3,"days":0}, decimal = 3, days = 90. Source: Gregorian calendar month lengths (ISO 8601).
4. start = 2024-03-10, end = 2026-05-20 gives months = {"months":26,"days":10}, decimal = 26.322581, span = {"years":2,"months":2,"days":10}.

## FAQ

### How do I count the months between two dates?

Step forward from the start date one month at a time, keeping the same day of the month, until one more step would pass the end date. Those are the whole months; the days from there to the end date are the days left. From January 15 to September 30, 2026 is 8 months and 15 days.

### How does the calculator handle the 31st of a month?

A day that a month does not have moves to the last day of that month. So January 31 plus 1 month is February 28 (February 29 in a leap year), and January 31 to March 15, 2026 is 1 month and 15 days.

### What does the decimal number of months mean?

It is the whole months plus the part of the next month that has passed. From January 15 to September 30, 2026: the last monthly date is September 15, 15 days before the end date, and the next is October 15, 30 days after it, so the answer is 8 + 15 ÷ 30 = 8.5 months.

### Why not divide the days by 30 or 30.44?

Because months have 28 to 31 days. Dividing by the length of the actual month means a whole number of months always comes out whole: from November 30, 2025 to February 28, 2026 is exactly 3 months.

### How many months ago was a date?

Leave the end date as today and enter the date as the start date. The page reads today’s date from your device when it loads, so the answer is right on the day you open it.

### Can the end date be before the start date?

No. If the end date is before the start date there is no answer; swap the two dates.

## Sources

- Jean Meeus, Astronomical Algorithms (1991), chapter 7: Julian Day numbers, so the days between two dates are the difference of their Julian Days.
- ISO 8601, Date and time format: the Gregorian calendar, its month lengths and leap-year rule.
