Beginner

Days in a Month

Enter a year and month to instantly see how many days it has, including correct leap-year handling for February.
Any 4-digit year

Month

Pick a month (1-12)
Days in February 2026
28

This is not a leap year.

First day falls on
Sunday
Last day falls on
Saturday
Leap year
No
February length
28 days
JanuaryDecember28 daysMonth position in the year
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

A month has 28 to 31 days. April, June, September and November have 30; the rest have 31, except February, which has 28 days normally and 29 in a leap year. Enter any year and month to get the exact count plus the weekday of the first and last day.

Formula
days = new Date(Year, Month, 0).getDate(); leap year if Year % 4 == 0 and (Year % 100 != 0 or Year % 400 == 0)
How this is calculated

You provide a year (Y) and a month (M) from 1 to 12. The calculator uses the JavaScript Date trick new Date(Y, M, 0): because the day-of-month index is 0, the date rolls back to the last day of month M, and getDate() returns that day number, which equals the number of days in the month.

Month lengths are fixed except for February. April, June, September and November have 30 days; January, March, May, July, August, October and December have 31. February has 28 days in a common year and 29 in a leap year. A year is a leap year when it is divisible by 4, except century years (divisible by 100) which must also be divisible by 400 — so 2000 is a leap year but 1900 is not.

The weekday of the first and last day is computed with getDay() (0 = Sunday through 6 = Saturday) using the local calendar. The bar chart shows all twelve months of the selected year for comparison, highlighting the chosen month. Inputs are truncated to whole numbers, and months outside 1-12 are rejected.

Frequently asked questions

28 days. 2026 is not a leap year because it is not divisible by 4, so February has the standard 28 days.

A year is a leap year if it is divisible by 4, except for century years, which must be divisible by 400. So 2024 and 2000 are leap years, but 2100 and 1900 are not.

It is a historical convention from the Roman calendar. Seven months have 31 days, four have 30, and February has 28 or 29, so the twelve months total 365 or 366 days.

Also known as

days in month
how many days in
days in february
month length
leap year february
number of days in month
days per month
month day count

APA

TG we-Calculate Editorial Team. (2026). Days in a Month [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/days-in-month

Chicago

TG we-Calculate Editorial Team. "Days in a Month." TG we-Calculate. 2026. https://we-calculate.com/calculator/days-in-month.

IEEE

TG we-Calculate Editorial Team, "Days in a Month," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/days-in-month

BibTeX

@misc{wecalculate_days_in_month, title = {Days in a Month}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/days-in-month}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?