ToolNimba

๐Ÿ“… Days in Month Calculator: How Many Days in Any Month

Shihab Mia By Shihab Mia ยท Updated 2026-07-08

Days in this month
-
Leap year
-

Pick a month and year to see how many days it has.

All 12 months
Month Days

This days in month calculator tells you exactly how many days are in any month of any year. Seven months have 31 days, four months have 30 days, and February has 28 days in a common year or 29 days in a leap year. Pick a month, type a year, and the tool shows the day count straight away, tells you whether that year is a leap year, and lays out a full table of all 12 months. It is handy for payroll, billing cycles, project planning, and settling the eternal question of how many days February has this year.

What is the Days in Month Calculator?

Most months have a fixed length that never changes. Seven months have 31 days (January, March, May, July, August, October and December) and four months have 30 days (April, June, September and November). February is the only month whose length depends on the year, holding 28 days in a common year and 29 days in a leap year. That single exception is the reason a calculator is useful at all, since every other month can be recalled with the old knuckle trick or the rhyme that begins thirty days has September.

The leap year rule exists because a year is not exactly 365 days long. The Earth takes about 365.2422 days to orbit the Sun, so a plain 365-day calendar drifts by almost a quarter of a day each year. Left uncorrected, the seasons would slowly slide across the calendar, and after a few centuries the summer months would fall in what we now call winter. To correct this, the Gregorian calendar adds a leap day to the end of February every four years, but with two refinements: a year divisible by 100 is not a leap year unless it is also divisible by 400. So 2000 was a leap year, 1900 was not, and 2100 will not be either. The full rule is: a year is a leap year if it is divisible by 4 and either not divisible by 100, or divisible by 400.

February is short for reasons that predate the leap rule entirely. The early Roman calendar attributed to Numa Pompilius avoided even numbers, which were considered unlucky, so most months were given 29 or 31 days and one month had to absorb the leftover even count. February, the month of Roman rituals honouring the dead, drew the short straw at 28 days. When Julius Caesar later reformed the calendar in 46 BC he redistributed days to reach 365, but February kept its historic shortness, and the Gregorian reform of 1582 preserved it. That is why the odd month out is February rather than any of the others.

There are two quick ways to remember the pattern without a tool. The rhyme runs: thirty days has September, April, June and November; all the rest have thirty-one, except February alone, which has twenty-eight days clear and twenty-nine in each leap year. The knuckle method uses the bumps and dips across the back of your hand: start at the little-finger knuckle as January, count each raised knuckle as a 31-day month and each dip between knuckles as a 30-day (or 28/29-day) month, run to the index knuckle at July, then start over at the little-finger knuckle for August. Every knuckle month has 31 days and every valley month has 30, with February as the sole exception.

Under the hood, this tool uses a reliable date trick rather than a lookup table. Asking for day zero of the following month, written as new Date(year, month, 0) in JavaScript, rolls back to the last day of the month you actually want, and reading that day number gives the length. Because the browser computes February using the real Gregorian leap rule, the answer is always correct for the year you enter, with no special cases to maintain and no chance of a stale table drifting out of date.

Knowing the exact day count matters more than it first appears. Rent, salaries, loan interest and subscription fees are often quoted per month but accrue per day, so a daily rate depends on whether the month has 28, 30 or 31 days. A tenant moving out mid-month, an employer prorating a partial paycheck, or a lender calculating daily interest all get a different figure in February than in March. The calculator removes the guesswork by giving you the precise number to divide by.

When to use it

  • Settling how many days February has in a given year, especially around leap years like 2024 and 2028.
  • Working out billing or subscription cycles that depend on the exact number of days in a month.
  • Calculating a daily rate for rent, salary, or loan interest by dividing a monthly figure by the real day count.
  • Prorating a partial month for a move-in, move-out, or mid-cycle plan change.
  • Planning project schedules or content calendars where you need each month length at a glance.
  • Checking historical or future February lengths for genealogy, contracts, or academic work.

How to use the Days in Month Calculator

  1. Choose the month you want from the dropdown list.
  2. Type the year (for example 2026) into the year field.
  3. Read off the number of days in that month and whether the year is a leap year.
  4. Scan the 12-month table to compare every month in the chosen year at once.

Formula & method

days in month = new Date(year, month, 0).getDate(), where month is 1 to 12. A year is a leap year when (year mod 4 = 0 and year mod 100 is not 0) or year mod 400 = 0, in which case February has 29 days instead of 28.
How Many Days in Each Month31 days7 months30 days4 months28 / 29FebruaryJan Mar May JulAug Oct DecApr Jun Sep Nov29 in leap yearsLeap year ruleDivisible by 4, but century years only if divisible by 400

Worked examples

How many days are in February 2024?

  1. Check the leap rule: 2024 mod 4 = 0, and 2024 mod 100 = 24 (not 0), so 2024 is a leap year.
  2. In a leap year February holds 29 days rather than 28.
  3. The tool confirms this with new Date(2024, 2, 0).getDate() = 29.

Result: February 2024 has 29 days.

How many days are in February 1900?

  1. Apply the leap rule: 1900 mod 4 = 0, so the basic test passes.
  2. But 1900 mod 100 = 0 and 1900 mod 400 = 300 (not 0), so the century exception applies.
  3. A century year that is not divisible by 400 is a common year, so February has 28 days.

Result: February 1900 had 28 days, not 29.

What is the daily rent for a 1,200 dollar month in February versus March 2026?

  1. February 2026 is a common year, so it has 28 days: 1200 / 28 = 42.86 dollars per day.
  2. March 2026 always has 31 days: 1200 / 31 = 38.71 dollars per day.
  3. The same monthly rent works out to about 4.15 dollars more per day in February because the month is shorter.

Result: A fixed monthly amount buys fewer days in February, so the per-day cost is higher than in a 31-day month.

Number of days in each month

MonthDaysNotes
January31Fixed
February28 or 2929 in a leap year, otherwise 28
March31Fixed
April30Fixed
May31Fixed
June30Fixed
July31Fixed
August31Fixed
September30Fixed
October31Fixed
November30Fixed
December31Fixed

Months grouped by length

LengthMonthsCount
31 daysJanuary, March, May, July, August, October, December7
30 daysApril, June, September, November4
28 or 29 daysFebruary only1

Is the year a leap year? February day count for sample years

YearLeap year?Days in February
2023No28
2024Yes29
2025No28
2026No28
2028Yes29
2000Yes (divisible by 400)29
1900No (century, not by 400)28
2100No (century, not by 400)28

Common mistakes to avoid

  • Assuming February always has 28 days. February gains a 29th day in every leap year, which is roughly one year in four. Treating it as always 28 days throws off any daily rate or schedule that falls in a leap February.
  • Thinking every fourth year is a leap year. The divisible-by-4 rule has a century exception. Years like 1700, 1800, 1900 and 2100 are divisible by 4 but are not leap years because they are not divisible by 400. The year 2000 is the rare century that is.
  • Off-by-one month numbering. In JavaScript the Date month argument is zero-based for normal use, but the day-zero trick new Date(year, month, 0) deliberately uses a one-based month. Mixing the two conventions gives the wrong month length.
  • Confusing days in a month with days in a billing period. A billing cycle that runs from the 15th to the 14th spans parts of two months, so its length is not the same as any single calendar month. Use a date difference calculator for spans that cross a month boundary.
  • Assuming every month averages about 30 days. The average month is about 30.4 days, but no single month is that length. Using 30 as a stand-in for payroll or interest can shortchange or overcharge by a day or two, which compounds over a year.
  • Forgetting that leap day is added to February, not December. The extra day in a leap year is February 29, not a day tacked onto the end of the year. Schedules built around a fixed 365-day count silently break in leap years unless you account for the February 29 slot.

Glossary

Leap year
A year with 366 days, where February has 29 days instead of 28, added to keep the calendar aligned with the Earth orbit.
Common year
An ordinary 365-day year in which February has 28 days.
Gregorian calendar
The calendar in worldwide civil use today, introduced in 1582, which defines the modern leap year rule.
Century year
A year ending in 00, such as 1900 or 2000, which is a leap year only when it is divisible by 400.
Leap day
February 29, the extra day inserted into a leap year to keep the calendar in step with the seasons.
Month index
A number identifying a month. This tool uses 1 for January through 12 for December.
Knuckle mnemonic
A memory trick using the knuckles and dips of the hand, where each raised knuckle is a 31-day month and each dip is a shorter month.
Tropical year
The time for the Earth to complete one cycle of seasons, about 365.2422 days, which the leap year rule approximates.

Frequently asked questions

How many days are in a month?

It depends on the month. Seven months have 31 days (January, March, May, July, August, October, December), four months have 30 days (April, June, September, November), and February has 28 days in a common year or 29 days in a leap year.

How many days are in February?

February has 28 days in most years and 29 days in a leap year. Leap years occur roughly every four years, so February gains its extra day about once every four years.

Which months have 31 days?

Seven months have 31 days: January, March, May, July, August, October and December. All four of the remaining full months (April, June, September, November) have 30 days, and February is the only variable month.

Which months have 30 days?

Four months have 30 days: April, June, September and November. The rhyme thirty days has September, April, June and November is the classic way to remember them.

How do I know if a year is a leap year?

A year is a leap year if it is divisible by 4, except for century years (those ending in 00), which must also be divisible by 400. So 2024 and 2000 are leap years, while 2023, 1900 and 2100 are not.

Why does February have a different number of days?

A solar year is about 365.2422 days, so a fixed 365-day calendar drifts. Adding a leap day to February every four years, with the century adjustments, keeps the calendar in step with the seasons. February was also historically the shortest month in the Roman calendar.

What is the knuckle trick for remembering days in each month?

Make a fist and count across your knuckles: each raised knuckle is a 31-day month and each dip between knuckles is a 30-day month (or February). Start at the little-finger knuckle for January, count to the index knuckle at July, then start over at the little-finger knuckle for August.

What is the average number of days in a month?

The average month is about 30.44 days, found by dividing 365.25 days by 12. No individual month is exactly that length, which is why using 30 or 31 as a shortcut can be slightly off for daily rate calculations.

How does this calculator work out the day count?

It asks the browser for day zero of the next month using new Date(year, month, 0), which rolls back to the last day of the month you chose. Reading that day number gives the exact length, including the correct February value for leap years.

Can I use this to prorate rent or salary for a partial month?

Yes. Find the number of days in the month, divide the monthly amount by that day count to get the daily rate, then multiply by the number of days the person actually occupied or worked. Using the real day count instead of a flat 30 keeps the proration accurate.