Days in a Month screenshot

Days in a Month

How many days a given month has, with its last day and whether the year is a leap year.

Privacy First
0 Runs
Updated 2026-11-22
Runs in your browser
States its rule
Nothing uploaded

What this Days in a Month calculator does

How many days a given month has, with its last day and whether the year is a leap year.

The month lengths follow the Gregorian calendar: 31, 28 or 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31. February has 29 days when the year is divisible by 4 and not by 100, or when it is divisible by 400, so 2000 is a leap year and 1900 was not. The page computes this rather than reading a table of centuries.

How to use it

Enter Year, Month (1-12), then press Calculate. The page recalculates as you type and runs the same operation again from the values on screen.

Worked example

Input:

Year = 2026
Month (1-12) = 2

Output:

Days in month = 28
Last day = 2026-02-28
Leap year = No

Why it runs in your browser

Every date is read as a civil date in this browser's local time zone: the page carries no time-zone database and no locale data, and nothing you type is sent anywhere.

Days in a Month: How many days a given month has, with its last day and whether the year is a leap year.

The month lengths follow the Gregorian calendar: 31, 28 or 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31. February has 29 days when the year is divisible by 4 and not by 100, or when it is divisible by 400, so 2000 is a leap year and 1900 was not. The page computes this rather than reading a table of centuries.

Worked example: Year = 2026, Month (1-12) = 2 gives Days in month = 28; Last day = 2026-02-28; Leap year = No.

How to use the Days in a Month calculator

Enter Year, Month (1-12), then press Calculate. The page recalculates as you type and runs the same operation again from the values on screen.

Every date is read as a civil date in this browser's local time zone: the page carries no time-zone database and no locale data, and nothing you type is sent anywhere.

  • Year — a whole number
  • Month (1-12) — a whole number

The rule this page applies

The month lengths follow the Gregorian calendar: 31, 28 or 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31. February has 29 days when the year is divisible by 4 and not by 100, or when it is divisible by 400, so 2000 is a leap year and 1900 was not. The page computes this rather than reading a table of centuries.

A year is a leap year when it is divisible by 4, except a century, which is a leap year only when divisible by 400. February therefore has 29 days in 2028 and 28 in 2026, and the page reads the real month length rather than a table.

  • Days in month = 28
  • Last day = 2026-02-28
  • Leap year = No

What to Expect

Best for

  • Checking a date by hand
  • Getting the days in month quickly
  • Comparing two candidate dates

Not ideal for

  • Statutory holiday calendars
  • Time-zone conversion
  • Locales other than English

What this tool keeps

  • Your inputs in this tab
  • The rule, printed in full
  • The same answer on every run

What may need cleanup

  • A date the page refuses, which names the reason instead of guessing
  • A count outside the supported range, which is refused by name

Common errors

  • A date that does not exist, such as 30 February, is refused rather than rolled forward
  • A blank field is refused rather than read as today
  • A written date in an order the page does not accept is refused by name

Example use cases

  • Planning around a deadline
  • Checking a date before you commit to it
  • Homework and exam checking

Sample input

Year = 2026, Month (1-12) = 2

Sample output

Days in month = 28; Last day = 2026-02-28; Leap year = No

Who this is for

  • Anyone checking a date by hand
  • Students and teachers

Frequently asked questions

What does the Days in a Month calculator do?

How many days a given month has, with its last day and whether the year is a leap year. The page prints days in month, last day, leap year.

How does this page count days?

The month lengths follow the Gregorian calendar: 31, 28 or 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31. February has 29 days when the year is divisible by 4 and not by 100, or when it is divisible by 400, so 2000 is a leap year and 1900 was not. The page computes this rather than reading a table of centuries.

How are leap years handled?

A year is a leap year when it is divisible by 4, except a century, which is a leap year only when divisible by 400. February therefore has 29 days in 2028 and 28 in 2026, and the page reads the real month length rather than a table.

Which time zone does the page use?

Every date is read as a civil date in this browser's local time zone: the page carries no time-zone database and no locale data, and nothing you type is sent anywhere.

What is the leap-year rule?

A year is a leap year when it is divisible by 4, except years divisible by 100, which are leap years only when they are also divisible by 400. So 2000 was a leap year and 1900 was not.

Why does February change length?

Because the Gregorian calendar keeps the year aligned with the seasons by adding one day to February nearly every fourth year. The page derives the length from the rule, not from a hard-coded list.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.