Last Day of Month Calculator

Enter a month and year to find the last day of that month. The calculator returns the final calendar date, the day of the week it falls on, and whether the year is a leap year — useful for billing cycles, deadlines, and date math. Also try the calculate Project Deadline Tracker.

Results

Last Day of Month

--

Full Date

--

Day of the Week

--

Leap Year?

--

Total Days in Month

--

Results Table

Whether you're tracking a pay period, closing out a fiscal schedule, or managing deadlines at the end of month, the last day of month calculator gives you an instant, precise answer about exactly when any given month closes. Knowing the final date of a given month matters more than it seems — subscription billing, rent calculation, project management, and educational scheduling all hinge on that single boundary date. Use this tool to identify a past date or future date with confidence, and eliminate the guesswork from every month-end task.

How to Use the Last Day of Month Calculator to Find Any Month-End Date

This month calculator is built for speed and simplicity. It handles all the date arithmetic internally, so you never have to remember which months have 30 days, which have 31 days, or whether a particular year's February ends on the 28th or 29th. The three-step process below covers everything you need to start date planning immediately.

Step-by-Step: Finding the Last Day of Any Month

  1. Set the starting date: Use the month and year inputs to set the initial reference point — the anchor from which the tool begins its date calculation. This is your beginning anchor for the entire operation.
  2. Choose the ending date (target month): Select the scheduling month whose final day you want to identify. The tool accepts any month across any year, past or future, making it equally useful for looking up a past date and planning a future one.
  3. Receive instant calculations: The moment both inputs are set, the tool instantly computes the correct end of month date — accounting for month length, leap year status, and all rules of the Gregorian system. No button press required.

The tool is particularly valuable for financial planning, event planning, and scheduling scenarios where missing a single day can mean a late payment or a missed deadline. Among date calculators of this type, it functions as both a date duration calculator and a precise month-end locator, making it one of the most versatile time and date tools available online.

What the Month Counter Reveals: How the Days in a Calendar Month Are Determined

Before your month counter can return a result, it needs to know one fundamental fact: how many days in a month you are querying. The answer varies by month and, in one important case, by year. Understanding these rules deepens your confidence in every date calculation result you receive.

Which Months Have 30 Days, 31 Days, or Fewer?

The Gregorian dating system — the most commonly used civil time standard worldwide and a reformed version of the Julian calendar that preceded it — distributes days across the year's twelve months as follows:

MonthDays (Common Year)Days (Leap Year)
January3131
February2829
March3131
April3030
May3131
June3030
July3131
August3131
September3030
October3131
November3030
December3131

As you can see, the months of April, June, September, and November have 30 days, while the remaining months carry 31 days — with the sole exception of February. February is the shortest month of the year and the only month affected by leap years. In a common year (a year that is not a leap year), 28 days in February is the rule. In a leap year, February has 29 days instead of 28, thanks to the leap day being introduced to the month of February every four years.

This month-length table is the backbone of all days calculation and month boundary logic. Every date to date calculator, every time elapsed tool, and every scheduling utility you encounter uses this same reference data internally.

Why February Is the Shortest Month — A Brief History

The answer to February's unusual length stretches back through centuries of calendar reform. The ancient Roman calendar was originally believed to be an observational lunar calendar system — making it an early example of the observational lunar approach — grounded in the cycles of the moon's phases that define many traditional lunar scheduling systems worldwide. Early Romans operated under a 10-month calendar with 304 days, leaving roughly 50 winter days unaccounted for. The Republican calendar that followed incorporated the Greek assumption of 29.5 days in a lunar cycle and 12.5 synodic months in a solar year, with the intercalary months of January and February added later to fill the gap.

In 46 BC, the system was further reformed by Julius Caesar, who fixed the total number of days in a year at 365 and introduced the intercalation of a leap day every fourth year — creating what we now call the Julian calendar. A standard year consists of 365 days, yet even this was imperfect: that Julian calendar still required further reform because it drifted with respect to the equinoxes and solstices by roughly 11 minutes per year. By 1582, that slow drift had produced a difference of 10 days between the dated position and the actual astronomical position of the Earth.

Pope Gregory XIII resolved the issue by skipping 10 days in the date — the day after October 4, 1582, became October 15 — and by refining the leap year algorithm so that century years not divisible by 400 would not be leap years. This change reduced the accumulated error from 1 day in 128 years to 1 day in 3,030 years relative to the mean tropical year. The adoption of the Gregorian system spread gradually across the globe, and it now stands as the world's dominant civil time system across all major scheduling frameworks for date planning. Unlike a fiscal schedule or regional dating system, it serves as the universal civil standard.

The Math Behind Calculating Months Between Two Dates

Knowing the month end date is useful, but understanding the formulas behind a time elapsed tool gives you the power to verify results, build spreadsheets, or write your own code. This section walks through the internal logic that any robust engine for finding the days between two dates — and the months between two dates — uses, including the exact formulas drawn from established calendar arithmetic practice. When you enter a start date end date pair, these are the calculations running behind the scenes.

Leap Year Calculation: Which Years Qualify?

Because February is the only month whose length varies, every leap year calculation directly affects month-end date results. The astronomical year is slightly longer than 365 days — precisely 365.24219 days long — which means a schedule that has only whole days in it will drift over time without correction. By adding an extra day (a process known as time insertion, or to use the technical label, intercalation) every four years, the annual count stays synchronized with the astronomical year or seasonal year that governs Earth's actual orbital period.

The three-condition algorithm to determine if a year is a leap year under the Gregorian system is:

  • If the year is exactly divisible by four, it is a leap year — unless it is also a century year.
  • If the year is precisely divisible by 100, it is not a leap year — unless the following condition is also met.
  • If the year is exactly divisible by 400, it is a leap year after all.

This means that years 1700, 1800, and 1900 are common years, while years 1600 and 2000 are leap years. The result: an extra day every four years compensates for the fractional difference between the annual count and the complete orbit of the Earth around the Sun, which takes approximately 365 days, 5 hours, 48 minutes, 45 seconds. A leap year is also known as a bissextile year or an intercalary year, and has exactly 12 months — the same count as a common year. The only change is the count of days in February.

In practical terms, this year classification is what this tool checks first whenever you query February. If the target year passes the leap year test, it returns February 29 as the final date; otherwise it returns February 28. No other month is affected by this leap year calculation.

Formulas for Counting Full Months Between Two Dates

When you want to calculate date duration precisely — not just find the month end date — the tool applies a set of formulas that handle two distinct scenarios. First, label your two reference points as the earlier date (ED) and the later date (LD). To find the number of years months weeks and days between dates, these formulas provide the foundation.

Scenario 1 — Dates occur within the same year:

The total count of full months is the sum of:

$$\text{Full months} = (\text{LD month} - \text{ED month}) + \frac{(\text{LD days} - \text{ED days})}{30.44}$$

The first term — LD month minus ED month — gives the whole-month count. The second term, dividing the day difference by 30.44 (the average days per scheduling month), captures any partial months left over. If the dates span across partial months, those remainders are expressed as a remaining day count rather than a fractional month.

Scenario 2 — Dates from different years:

The number of full months between chosen dates is the sum of three terms:

$$\text{Full months} = (\text{LD years} - \text{ED years} - 1) \times 12 + (12 - \text{ED month} + \text{LD month}) + \frac{(\text{LD days} - \text{ED days})}{30.44}$$

Breaking this down step by step:

  1. Identify your reference points: Write down the earlier date (ED) and later date (LD), noting their day, month, and year components separately.
  2. Calculate the year gap: $$\text{Year gap} = (\text{LD years} - \text{ED years} - 1) \times 12$$ This converts the span of years between the two dates (minus one, to avoid double-counting) into months — producing a years calculation expressed in months.
  3. Add the month span: $$\text{Month span} = 12 - \text{ED month} + \text{LD month}$$ This term counts the elapsed months across the year boundary.
  4. Add fractional days: $$\text{Day fraction} = \frac{\text{LD days} - \text{ED days}}{30.44}$$ This component handles any leftover days below a full-month threshold.
  5. Sum all three: Add the year gap, month span, and day fraction to get the exact number of months between two dates. The result reflects a precise date interval expressed in full months plus any remaining elapsed days.

This calendar math and calendar arithmetic underpins every reliable time elapsed tool and scheduling utility available today. Whether you need to measure the duration between two dates for calculating rent or subscriptions, confirm the interval between two points for contract terms, or track elapsed time for educational schedules, these formulas deliver the answer.

How Many Months Between Two Dates — Holidays, Business Days, and Practical Applications

Understanding how many months fall between two dates is only part of the picture. Real-world date planning often requires you to factor in holidays and business days — and knowing how these interact with month-end dates can make or break a project schedule.

U.S. Federal Holidays and Their Impact on Month-End Date Calculations

A holiday is a day set aside by custom or by law during which regular activities like going to work or school are suspended. In the United States, paid leave is typically referred to as vacation, while national, religious, or cultural days off carry the label "holiday." For date calculation purposes, the distinction matters: when a month-end date falls on a u.s. holidays observance, business day calculation and holiday scheduling must be adjusted accordingly.

Under U.S. rules, on designated public observances, non-essential government offices are closed and federal employees receive paid leave. Private sector workers may receive holiday pay in addition to their regular wages if required to work. Public observances specific to a given country can be entered manually into most advanced scheduling tools, and certain holidays can also be excluded from business days settings when calculating net working days.

Some U.S. public holidays are fixed observances that fall on the same date every year — for example, New Year's Day on January 1, Juneteenth Day on June 19, Independence Day on July 4, Veteran's Day on November 11, and Christmas on December 25. Others follow a floating Monday or floating Thursday pattern. Martin Luther King Jr. Day falls on the third Monday of January, President's Day occurs on the third Monday of February, Memorial Day lands on the last Monday of May, Labor Day on the first Monday of September, Columbus Day on the second Monday of October, and Thanksgiving on the fourth Thursday in November.

Below are the dates of U.S. federal holidays for 2026 and 2027, useful as a quick holiday settings reference when you need to calculate business days around month boundaries.

Holiday2026 U.S. Federal Holidays2027 U.S. Federal Holidays
New Year's DayJan. 1, 2026Jan. 1, 2027
Martin Luther King Jr. DayJan. 19, 2026Jan. 18, 2027
President's DayFeb. 16, 2026Feb. 15, 2027
Memorial DayMay 25, 2026May 31, 2027
Juneteenth DayJun. 19, 2026Jun. 19, 2027
Independence DayJul. 4, 2026Jul. 4, 2027
Labor DaySep. 7, 2026Sep. 6, 2027
Columbus DayOct. 12, 2026Oct. 11, 2027
Veteran's DayNov. 11, 2026Nov. 11, 2027
ThanksgivingNov. 26, 2026Nov. 25, 2027
ChristmasDec. 25, 2026Dec. 25, 2027

When a month's final day coincides with one of these nationally recognized observances, your workday calculator or business day tool must shift deadlines accordingly. The business day calculation logic used by most advanced date tools treats these public holidays as non-working days, which directly affects date difference results expressed in net working days rather than raw scheduled days.

Practical Use Cases: From Subscription Billing to Educational Scheduling

The everyday value of a precise date interval tool extends far beyond simple curiosity. Here are the most common real-world scenarios where knowing the exact month-end date — and the number of full months between chosen dates — makes a meaningful difference:

  • Subscription billing and rent calculation: Most services and leases bill to the last day of a scheduled month. Knowing whether that ending date is the 28th, 29th, 30th, or 31st affects pro-rated amounts and days remaining in month calculations.
  • Project management and deadline tracking: Planning and tracking project timelines requires accurately measuring the duration between two dates across months and years. A single-day error in month boundary identification can cascade into missed milestones.
  • Financial planning and fiscal alignment: Accountants and analysts use date subtraction and date addition routinely to align reporting periods with fiscal schedule boundaries. The number of years, months, weeks, and days between dates is a standard metric in financial statements.
  • Educational scheduling: Semester boundaries, term lengths, and examination windows all depend on reliable timeline calculation and period measurement. Knowing how many months are between two dates helps administrators build accurate academic timetables.
  • Personal events and time period tracking: From anniversary countdowns to tracking age milestones, day counting and months calculation keep personal events anchored to accurate dates. If you have a birthday on the 29th of February, for instance, leap year status directly changes which day you celebrate in common years.

For each of these scenarios, the ability to instantly compute months — and to add to or subtract from a date any specific number of days, months, or years — eliminates manual counting errors and saves meaningful time. The tool also supports date manipulation in both directions: you can identify a past date by subtracting intervals, or locate a date in the future by adding them. A tool that subtracts days, weeks, months, and years from a given date is equally as powerful as one that adds forward, and both modes rely on the same underlying date math and date interval logic.

March, the Months' Origin, and Why Scheduling Names Still Matter

One last dimension of date arithmetic worth appreciating: the names and ordering of months carry historical weight that connects modern date calculation to the ancient Roman calendar. The month of March named after the Roman system's first month, Martius, which is Martius derived from Mars, the Roman god of war — and father of Romulus and Remus. This lineage explains why September, October, November, and December (whose Latin roots mean seventh, eighth, ninth, and tenth) now occupy positions nine through twelve after the intercalary months of January and February were prepended to the year.

Understanding this history reinforces why February sits where it does and why it carries the leap day — it was the last month added, bolted onto a system that was originally built for a different time duration model. Every modern date elapsed tool, scheduling reference, and time calculation engine you use today is the direct descendant of these ancient decisions about date addition, time insertion, and time elapsed measurement. Appreciating that lineage makes the output of this last day of month calculator feel less like a number and more like a precise coordinate in a system refined over two millennia of human time planning.

How many days are in each month?

January, March, May, July, August, October, and December each have 31 days. April, June, September, and November have 30 days. February has 28 days in a standard year and 29 days in a leap year. See also our Date to Date Calculator (Duration).

What is a leap year?

A leap year is a year with 366 days instead of the usual 365, achieved by adding an extra day (February 29) to the calendar. This adjustment keeps the calendar in sync with the Earth's orbit around the Sun.

When is a leap year?

A year is a leap year if it is divisible by 4, except for century years (e.g. 1900), which must be divisible by 400 to qualify. So 2000 was a leap year, but 1900 was not. The next leap year after 2024 is 2028.

Why does February have fewer days than other months?

February's shorter length dates back to the ancient Roman calendar. When Julius Caesar reformed the calendar, the extra days needed to align with the solar year were distributed across other months, leaving February with just 28 (or 29 in a leap year). You might also find our use the Doomsday Calculator useful.

Which is the shortest month?

February is always the shortest month, with only 28 days in a standard year and 29 days in a leap year.

How do I find the last day of a month programmatically?

A common trick is to find the first day of the next month and subtract one day. In JavaScript, for example, new Date(year, month, 0).getDate() returns the last day of the previous month — which is the same as the last day of your target month if you pass month+1.

Why would I need to know the last day of a month?

Knowing the last day of a month is useful for billing cutoffs, loan payment schedules, contract end dates, payroll processing, project deadlines, and any date-sensitive financial or legal calculations.

Does the last day of a month change based on the year?

Only for February. In a leap year, February ends on the 29th instead of the 28th. All other months have the same number of days every year regardless of whether it is a leap year.