Month Calculator
Calculate months between two dates, add months to a date, or subtract months. Includes full breakdown in years, months, days and weeks — plus a quick-reference table and recurring event planner. Handles leap years automatically.
Generate a series of dates for recurring monthly events (subscriptions, loan payments, rent, appointments).
| Months Added | Future Date | Past Date | Day of Week |
|---|
📋 Table of contents
How to calculate months between two dates
Counting the months between two dates requires careful handling of partial months and varying month lengths. Here is the standard algorithm:
How to add months to a date
Adding months to a date is straightforward except for one edge case: months have different lengths. The JavaScript Date object handles this automatically using "end-of-month clamping":
Month lengths and leap years
| Month | Days | Quarter | Notes |
|---|---|---|---|
| January | 31 | Q1 | — |
| February | 28 or 29 | Q1 | 29 days in leap years |
| March | 31 | Q1 | — |
| April | 30 | Q2 | — |
| May | 31 | Q2 | — |
| June | 30 | Q2 | — |
| July | 31 | Q3 | — |
| August | 31 | Q3 | — |
| September | 30 | Q3 | — |
| October | 31 | Q4 | — |
| November | 30 | Q4 | — |
| December | 31 | Q4 | — |
A leap year occurs when the year is divisible by 4, except for century years (e.g. 1900) which must be divisible by 400 (so 2000 was a leap year, but 1900 was not). Leap years matter when calculating months that span February.
Common use cases for the month calculator
- Lease & rental agreements — Confirm the exact end date of a 12-month or 24-month lease. Verify how many months of rent have elapsed.
- Subscription billing — Calculate when a 6-month, 12-month, or 18-month subscription will renew. Find past billing dates for disputes.
- Loan amortisation — Determine how many months remain on a mortgage or car loan. Calculate the exact payoff month.
- Pregnancy milestones — Track gestational months (pregnancy is approximately 9 months / 40 weeks). Calculate due dates from LMP.
- Project planning — Break a multi-year project into monthly milestones. Calculate sprint end dates and quarterly reviews.
- Visa & permit duration — Many visa categories are granted in months. Calculate exact expiry dates and renewal windows.
- Warranty & guarantee periods — Determine exactly when a 12-month or 24-month warranty expires from purchase date.
- Age calculations — Determine someone's exact age in months (useful for infant development tracking and medical contexts).