Duration Calculator in Months: How It Works
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
A duration calculator in months works out the exact number of full months between two dates, and it also gives you the leftover days so you can see the precise gap at a glance. You enter a start date and an end date, and the calculator returns the total months, plus any remaining days and the total days overall. It is the standard tool for lease terms, subscription billing, project timelines, and age calculations in months.
Formula
The calculator uses the standard calendar-month difference method:
- Full months = (year2 − year1) × 12 + (month2 − month1) − (1 if day2 < day1, otherwise 0)
- Leftover days = (day2 − day1 + 30) mod 30 (a simplified estimate; see note below)
- Total days = actual number of days between the two dates, counting the start date but not the end date
Variables: year1, month1, day1 are the start date’s components; year2, month2, day2 are the end date’s components. All are integers. The formula treats a month as a calendar month, not as 30 or 31 days, which is the correct way for most real-world uses.
Worked Example
Using the default values: start date = 2024-01-15, end date = 2025-03-20.
- Years difference: (2025 − 2024) × 12 = 12 months
- Months difference: (3 − 1) = 2 months → total so far = 14 months
- Day check: day2 (20) is not less than day1 (15), so no subtraction → full months = 14
- Leftover days: (20 − 15 + 30) mod 30 = 35 mod 30 = 5 days
- Total days: Jan 15 to Mar 20 in 2024–2025 is 65 days (16 remaining in Jan + 29 in Feb 2024 + 20 in Mar)
The calculator shows 14 months, 5 leftover days, and 65 total days. This matches the formula output exactly.
When to Use a Month Duration Calculator
You need this calculator whenever a time span is expressed in months rather than weeks or years. Common situations include:
- Lease and rental agreements – most residential leases run 12 months, but some are 6, 9, or 15 months; the exact end date matters for move-out notices.
- Subscription and billing cycles – a monthly plan that starts on Jan 15 renews on Feb 15, not on Feb 1; the calculator shows how many full billing months have passed.
- Project timelines – if a project starts on March 10 and ends on June 10, that is exactly 3 months; if it ends on June 9, it is 2 months and 30 days.
- Age in months for infants – pediatric growth charts often use months, and parents want to know “how many months and days� a baby is.
- Warranty or contract periods – a 24-month warranty that starts on a specific date expires on the same day-of-month two years later.
How to Read the Result
The first number, full months, is the count of complete calendar months between the two dates. The leftover days are the days that remain after those full months, but they are an approximation because months have different lengths (28–31 days). The total days is the exact day count, which is the most precise measure.
For example, from Jan 31 to Feb 28 is 0 full months and 28 days, not 1 month. From Jan 31 to Mar 1 is 1 full month (Feb) plus 1 day, because the month of February is counted as a whole month even though it has only 28 days.
Common Mistakes and Misconceptions
A frequent error is assuming every month has 30 days. That leads to wrong answers for spans that cross February or months with 31 days. For instance, from Feb 10 to Mar 10 is exactly 1 month, but a 30-day calculation would give 1 month and 0 days only if February had 30 days – it doesn’t, but the calendar-month method still treats it as 1 month because the day-of-month matches.
Another mistake is mixing up “inclusive� and “exclusive� counting. If an event starts on the 1st and ends on the 1st of the next month, most people call that “one month,� but the exact day count is 31 days (if the month has 31 days). The calculator counts the start date but not the end date, which is the standard convention for durations.
Also, be careful with the leftover days output: it uses a simplified 30-day month model, so it may differ from the true remaining days by a day or two. For exact day counts, rely on the total days output.
Limits of the Formula
This calculator uses the Gregorian calendar and does not account for time zones or daylight saving time. If you need precision to the hour, you must include times and time zones. Also, the formula assumes a standard month definition; some financial contexts (like bond calculations) use a 30/360 day-count convention, where every month is treated as 30 days and a year as 360 days. That is a different method and will give different results.
For dates far in the past or future, the Gregorian calendar is assumed, which is the civil calendar in most of the world. Historical dates before 1582 may require the Julian calendar, but that is rarely relevant for typical use.
Alternatives and Related Calculators
If you need a different time unit, consider these:
- Days between dates – gives the exact number of days, useful for billing or countdowns.
- Weeks between dates – for work schedules or academic terms.
- Years and months – for age or service length, where you want years plus remaining months.
- Business days calculator – counts only weekdays, excluding weekends and optionally holidays.
Each calculator uses the same date-difference logic but expresses the result in different units.
Frequently Asked Questions
How many months is 90 days?
It depends on the start date. If you start on March 1, 90 days later is May 30, which is 2 full months and 29 days. If you start on January 1, 90 days later is April 1, which is 3 full months exactly (because January, February, and March are all complete). The calculator handles this automatically by using calendar months.
Is a month 30 days or 31 days?
Neither – a month is a calendar month. February has 28 or 29 days, while other months have 30 or 31. When you calculate duration in months, you count whole calendar months, not fixed 30-day blocks. That is why the leftover days can vary.
What does “full months� mean?
A full month is a complete calendar month from a given day-of-month to the same day-of-month in the next month. For example, from April 15 to May 15 is one full month. If the end date is before the same day-of-month, that month is not counted as full.
How do I calculate months between two dates in Excel?
Excel’s DATEDIF function can do it: =DATEDIF(start_date, end_date, “m”) gives full months, and =DATEDIF(start_date, end_date, “md”) gives leftover days. The logic is the same as this calculator.
Why does the leftover days number sometimes seem off?
The leftover days output uses a simplified 30-day month for the remainder, so it may differ from the actual days by a day or two. For example, from Jan 31 to Mar 1, the true leftover days are 1 (Feb 28 is the only full month), but the simplified formula might show 1 day as well – but in other cases like Jan 31 to Mar 2, it would show 2 days while the real count is 2. The discrepancy appears when crossing months with 31 days. Always use the total days output for exactness.
Related
Formula used
in d1 | Start date | - | 2024-01-15 | 0 in d2 | End date | - | 2025-03-20 | 0 out months | Full months | months | (y2 - y1) * 12 + (m2 - m1) - (d2 < d1 ? 1 : 0) | 0 out days_left | Leftover days | days | (d2 - d1 + 30) % 30 | 0 out total_days | Total days | days | (d2 - d1) | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.