notAcalculator logo

Calendar Calculator

Find how many days are in any month, check leap years, and see the first and last weekday with ISO-8601 week numbers in a single calendar grid for any year.

Calendar Calculator

Give us your feedback! Was this useful?

Introduction

A Calendar Calculator turns a month and a year into a complete picture of that month: how many days it contains, whether the year is a leap year, which weekday the month begins and ends on, how many rows a printed grid needs, and which ISO-8601 week numbers the month spans. Instead of flipping through a paper planner or trusting a phone widget, you get the arithmetic behind the calendar — the same rules that operating systems, payroll engines, and scheduling tools apply internally.

Calendars feel simple because we read them every day, but the rules underneath them are conditional. Month lengths alternate between 28, 29, 30, and 31 days without a repeating pattern. February changes length every four years — except in century years that are not divisible by 400. Weekday names shift by one day each year, and by two days after a leap year. Week numbers restart in January, but the first week of an ISO year is the week that contains the first Thursday, not the week that contains January 1 [iso-8601]. Any of those rules can quietly break a schedule, a payslip, or a printed calendar.

The Gregorian calendar, introduced in 1582 and now the world's dominant civil calendar, supplies all of them [timeanddate-gregorian-calendar]. This calculator implements the rules directly rather than looking up a table: the 4/100/400 leap-year test, leap-aware month lengths, Zeller's congruence for weekdays, and the ISO-8601 week-numbering scheme.

Questions this calculator answers

  • How many days are in February 2024 compared with February 2100?
  • Which weekday does the 1st of the month fall on, so you know how many blank cells precede it in a grid?
  • How many week rows does the month occupy when it is laid out Sunday-first or Monday-first?
  • Which ISO week numbers does the month cover, so weekly reports and timesheets can be labelled correctly?

Where it fits in the Dates & Time cluster

The Calendar Calculator is the "structure of a month" member of the family. The Day Counter Calculator measures the distance between two dates; the Date Calculator adds and subtracts days, weeks, and months from a starting point; the Day of the Week Calculator names the weekday of a single date; and the Time Duration Calculator converts elapsed time into hours, minutes, and seconds. This tool explains the boundaries those tools run into — the month length, the leap-year exception, and the week offset that decides whether a month fits in four, five, or six rows.

How to Use

The calculator takes three inputs and returns a full month view immediately, with no submit button.

  1. Month — pick any month from January to December.
  2. Year — enter a year between 1 and 9999. Values outside that range are rejected with a clear error message instead of a silent wrong answer.
  3. Week starts on — choose Sunday for the convention used in the United States, Canada, and Japan, or Monday (ISO) for the convention used across most of Europe, in ISO-8601 documents, and in business week numbering [iso-8601].

Results update as you type. Days in month is the featured figure; below it you get leap-year status, the first and last weekday of the month, the number of week rows the grid needs, the ISO week numbers the month covers, and the weekday the grid starts on. The grid itself labels every row with its ISO week number, so you can read the month and the week numbering at the same time.

Example 1: October 2026 with a Monday start

Inputs: month October, year 2026, week starts on Monday.

  • Days in month: 31
  • Leap year: No
  • First day of month: Thursday
  • Last day of month: Saturday
  • Weeks in view: 5
  • ISO weeks covered: 40–44
  • Week starts on: Monday

The grid shows exactly why. October 1, 2026 is a Thursday, so the first row carries three empty cells (Monday, Tuesday, Wednesday) before the 1 lands in the Thursday column. Three blanks plus 31 days is 34 cells, and 34 divided by 7 rounds up to 5 rows. The first row belongs to ISO week 40, and the last row — October 26 through 31 — belongs to ISO week 44.

Example 2: February 2024 compared with February 2025

Switch the month to February and the year to 2024, keeping the Monday start:

  • Days in month: 29 (leap year: Yes)
  • First day: Thursday, last day: Thursday
  • Weeks in view: 5
  • ISO weeks covered: 5–9

Now change only the year to 2025:

  • Days in month: 28 (leap year: No)
  • First day: Saturday, last day: Friday
  • Weeks in view: 5
  • ISO weeks covered: 5–9

Both Februaries span the same five ISO weeks, but they are shaped differently. February 2024 starts on a Thursday, so its first row holds only four days; February 2025 starts on a Saturday, so its first row holds just two. Same ISO span, different grid geometry — the kind of detail that matters when you lay out a schedule or count working days inside the month.

Example 3: February 2100 and the century exception

Enter February 2100. The year is divisible by 4, so a naive four-year rule would call it a leap year. It is not:

  • Days in month: 28
  • Leap year: No
  • First day: Monday, last day: Sunday
  • Weeks in view: 4
  • ISO weeks covered: 5–8

Because February 2100 starts on a Monday, it needs no leading blank cells at all and fits into exactly four rows — one of the few ways a February can fill a four-row grid. February 2000, by contrast, was a leap year because 2000 is divisible by 400, and it returned 29 days.

Example 4: the ISO year boundary in January 2027

Enter January 2027 with the Monday start:

  • Days in month: 31
  • ISO weeks covered: 53–4

The month begins inside ISO week 53 of 2026 and ends in ISO week 4 of 2027. That is normal behaviour rather than a bug: ISO weeks belong to the year that contains their Thursday, so the first days of January can still belong to the previous ISO year [iso-8601]. The same effect appears in reverse at the end of December 2026, which spans ISO weeks 49 to 53.

The Formula

Four rules drive every result on this page. Each one is a closed-form expression, so the calculator never needs to iterate day by day.

Leap years

A year is a leap year when it is divisible by 4, unless it is a century year that is not divisible by 400:

Leap(y)={truey mod 400=0falsey mod 100=0truey mod 4=0falseotherwise\text{Leap}(y) = \begin{cases} \text{true} & y \bmod 400 = 0 \\ \text{false} & y \bmod 100 = 0 \\ \text{true} & y \bmod 4 = 0 \\ \text{false} & \text{otherwise} \end{cases}
[timeanddate-gregorian-calendar]

In words: 2024, 2028, and 2400 are leap years; 1900 and 2100 are not; 2000 is. The rule holds the average calendar year at 365.2425 days, close to the 365.2422-day tropical year.

Days in a month

Once leap status is known, the length of the requested month follows from a small set of cases:

Days(y,m)={29m=2 and Leap(y)28m=2 and ¬Leap(y)30m∈{4,6,9,11}31otherwise\text{Days}(y, m) = \begin{cases} 29 & m = 2 \ \text{and} \ \text{Leap}(y) \\ 28 & m = 2 \ \text{and} \ \lnot \text{Leap}(y) \\ 30 & m \in \{4, 6, 9, 11\} \\ 31 & \text{otherwise} \end{cases}
[timeanddate-duration]

April, June, September, and November have 30 days; every month except February has 31 days in the remaining cases. February is the only month whose length depends on the year [timeanddate-duration].

Weekday of a date: Zeller's congruence

The weekday is computed with Zeller's congruence in its Gregorian form, where q is the day of the month, m is the month number, and y is the year:

h=(q+⌊13(m+1)5⌋+K+⌊K4⌋+⌊J4⌋+5J) mod 7h = \left( q + \left\lfloor \frac{13(m + 1)}{5} \right\rfloor + K + \left\lfloor \frac{K}{4} \right\rfloor + \left\lfloor \frac{J}{4} \right\rfloor + 5J \right) \bmod 7

January and February are treated as months 13 and 14 of the previous year, which keeps the expression linear across the new year. The remaining terms are the year inside the century and the century number:

K=y mod 100,J=⌊y100⌋K = y \bmod 100, \qquad J = \left\lfloor \frac{y}{100} \right\rfloor

Zeller returns 0 for Saturday, 1 for Sunday, and so on. The calculator shifts that to the 0 = Sunday convention used by JavaScript's Date object [mdn-getday]:

dow=(h+6) mod 7\text{dow} = (h + 6) \bmod 7

so dow = 0 is Sunday, dow = 3 is Wednesday, and dow = 6 is Saturday. October 1, 2026 evaluates to dow = 4, which is Thursday [mdn-date]. The same technique is what a general-purpose day-of-week lookup does for a single date; here it is applied to the first and last day of the month so the grid can be built.

Grid offset and rows in view

The offset is the number of blank cells before day 1, and it depends on the chosen week start:

offset={(dow+6) mod 7Monday startdowSunday start\text{offset} = \begin{cases} (\text{dow} + 6) \bmod 7 & \text{Monday start} \\ \text{dow} & \text{Sunday start} \end{cases}

The number of rows a month occupies is then the month length plus the offset, divided into blocks of seven and rounded up:

rows=⌈Days(y,m)+offset7⌉\text{rows} = \left\lceil \frac{\text{Days}(y, m) + \text{offset}}{7} \right\rceil

For October 2026 with a Monday start: offset = (4 + 6) mod 7 = 3, days = 31, so rows = ceil(34 / 7) = 5. The same expression explains the rare six-row months — March 2026 starts on a Sunday, giving offset = 6 and rows = ceil(37 / 7) = 6.

ISO week numbers

An ISO week runs Monday through Sunday, and week 1 is the week that contains the first Thursday of the year — equivalent to the week that contains January 4. The calculator finds the Thursday of the week that contains the date, then counts seven-day steps from the Thursday of week 1:

W=1+T(d)−T17W = 1 + \frac{T(d) - T_1}{7}
[iso-8601]

where T(d) is the Thursday of the ISO week containing the date d and T1 is the Thursday of ISO week 1. Because the Thursday can fall in a different calendar year, the same method also yields the ISO week-year, which may differ from the calendar year near January 1 and December 31 — January 1, 2021 belongs to ISO week 53 of 2020 [iso-8601]. General-purpose date libraries expose the identical convention through functions such as getISOWeek [date-fns-iso-week].

Reference Table

Month lengths in common and leap years

January31310
February28291
March31310
April30300
May31310
June30300
July31310
August31310
September30300
October31310
1–10 of 12
1 / 2
Common-year month lengths. Seven months run 31 days, four run 30, and February is the outlier at 28 — rising to 29 in a leap year.

Seven months have 31 days, four have 30, and February has 28 in a common year and 29 in a leap year. That is why a calendar year is 365 days most of the time and 366 days when February gains a day, and why the "thirty days hath September" rhyme works as a memory aid but never as an arithmetic rule.

ISO week spans and grid rows for sample months

February 200029595
February 202429595
February 210028584
October 20263140445
December 20263149535
January 2027315345

The table shows the three shapes a month can take. A February that starts on a Monday needs only four rows; most months need five; and a 30- or 31-day month that starts on a Sunday (Monday start) needs six, because six blank cells plus 31 days overflows the fifth row by one cell.

Practical Tips

Tip 1: Match the week start to your audience

Choose Monday (ISO) when the calendar feeds business reporting, European payroll, or an ISO-8601 document, and choose Sunday when it feeds a consumer-facing US or Canadian calendar. Changing the week start does not change the month length or the ISO week numbers; it only changes how many blank cells appear before day 1 and, in some months, whether the grid needs five or six rows.

Tip 2: Never assume a 30-day month in billing

Interest, rent, and subscription proration depend on the real month length. January, March, May, July, August, October, and December carry 31 days; April, June, September, and November carry 30; February carries 28 or 29. Dividing a monthly rate by 30 for every month understates the daily cost of long months by roughly three percent.

Tip 3: Use ISO weeks for weekly reporting

Weekly timesheets, sprint reports, and production logs are easier to reconcile when they are labelled with ISO week numbers, because ISO weeks always run Monday through Sunday and every week has exactly seven days. Remember that the ISO week-year can differ from the calendar year in the first and last days of January and December [iso-8601], so a report dated January 1, 2027 belongs to week 53 of the previous ISO year.

Tip 4: Check February before planning century-year milestones

Any plan that stretches past 2099 should be tested with this calculator. 2100 is divisible by 4 but not by 400, so February 2100 has 28 days and the year has 365. A twenty-year amortisation, pension, or lease schedule that assumes a leap day in 2100 will be off by one day, and that single day propagates through every subsequent payment date.

Tip 5: Size printed grids from weeks in view

A paper or PDF calendar template with a fixed five-row body will clip any month that needs six rows. March 2026 and November 2026 both need six rows with a Monday start, while the same months need five when the grid starts on Sunday. Read the weeks in view figure before choosing a template.

Tip 6: Pair the month view with a business-day count when holidays matter

This calculator describes the structure of the month; it does not know about public holidays. When a deadline depends on working days, take the month structure from here and then exclude weekends and holidays with a dedicated business-day calculation, using a holiday reference for the relevant country [office-holidays].

Limitations

1. Gregorian calendar only

The calculator implements the Gregorian calendar, introduced in 1582. It does not convert from the Julian, Islamic, Hebrew, Chinese, or Persian calendars, and it does not apply the historical adoption dates at which individual countries switched systems. Dates before 1582 are computed as if the Gregorian rules had always applied, which is useful for arithmetic but not for historical research.

2. No time zone or daylight saving awareness

Only calendar dates are involved, so time zones and daylight saving transitions never change the result. This is the right behaviour for planning and reporting, but it means the tool cannot tell you how many hours a day contains in a particular time zone — use a time-based tool for that.

3. No holiday or working-day logic

The grid shows every calendar day of the month. It does not mark public holidays, weekends, or company shutdown days, and it does not count business days. Those decisions depend on jurisdiction and on the observer's work pattern, so they belong in a business-day calculation with an explicit holiday list.

4. Two week-start options only

The grid can begin on Sunday or Monday. It cannot begin on Saturday, which is the conventional start in parts of the Middle East, and it cannot produce a Wednesday-start week or any other custom offset.

5. No fiscal or retail calendars

Fiscal years, 4-4-5 retail calendars, ISO week-based years, and accounting periods that start mid-month are outside the scope of the tool. It models civil months, not business periods.

6. Year range is capped

The year input accepts values from 1 to 9999. Values outside that range return an error instead of a result, which keeps four-digit year handling consistent and avoids the ambiguity of abbreviated or expanded year formats.

7. No partial days

Results are whole calendar days. The calculator cannot express half days, hours, or minutes, and it does not model inclusive or exclusive date boundaries — it describes the month itself, not a range within it.

Frequently Asked Questions

❓ What does the Calendar Calculator actually show?
✅ For any month and year it returns the number of days in the month, whether the year is a leap year, the weekday the month starts and ends on, the number of week rows a calendar grid needs, the ISO week numbers the month covers, and a full grid with ISO week labels on every row.
❓ Why does February sometimes have 29 days?
✅ February gains a day in leap years. A year is a leap year when it is divisible by 4, unless it is a century year that is not divisible by 400. So 2024 and 2028 have 29 days in February, 1900 and 2100 have 28, and 2000 had 29 because it is divisible by 400.
❓ What is the difference between a Sunday start and a Monday start?
✅ Only the position of the blank cells before the 1st changes. A Monday start shifts every column one place to the left relative to a Sunday start, and in some months it changes the row count between five and six. Month length and ISO week numbers are unaffected.
❓ What are ISO week numbers?
✅ ISO-8601 numbers weeks from 1 to 52 or 53. Week 1 is the week that contains the first Thursday of the year, which is the same as the week containing January 4. ISO weeks always run Monday through Sunday, which is why the ISO convention pairs naturally with a Monday start.
❓ Why can January show a week number like 53?
✅ Because the ISO week-year can differ from the calendar year. Weeks belong to the year that contains their Thursday, so January 1, 2027 falls inside ISO week 53 of 2026, and December 31, 2020 falls inside ISO week 53 of 2020. The label is correct even though it looks out of sequence.
❓ Why do some months need six rows in the grid?
✅ When the offset plus the number of days exceeds 35 cells, a sixth row is required. That happens when a 30 or 31 day month starts late in the week. March 2026 and November 2026 both need six rows with a Monday start because each begins on a Sunday.
❓ Does the calculator know about public holidays?
✅ No. It models the structure of the calendar month only. Holidays, weekends, and company shutdown days are not marked, and the tool does not count business days. Use a business-day calculation with an explicit holiday list for deadlines that depend on working days.
❓ Can I use it for a fiscal year or a 4-4-5 retail calendar?
✅ No. The tool models Gregorian civil months. Fiscal years, 4-4-5 retail periods, and accounting calendars that begin mid-month use different boundaries and are outside its scope.
❓ Does it work for dates before 1582?
✅ It returns a result, but it applies Gregorian rules to every year, including years before the Gregorian reform. Those results are arithmetically consistent yet historically inaccurate for countries that were still using the Julian calendar.
❓ Why is the year limited to a range of 1 to 9999?
✅ The limit keeps the input in four-digit form and makes the leap-year and Zeller calculations unambiguous. Any value outside the range returns a validation error rather than a misleading date.
❓ Is the result affected by daylight saving time?
✅ No. The calculator works with calendar dates, not instants in time, so a daylight saving transition never adds or removes a day. The month always contains exactly the number of dates shown in the grid.

References

  1. [1]Time and Date. (n.d.). *Gregorian Calendar*. https://www.timeanddate.com/calendar/gregorian-calendar.html
  2. [2]Time and Date. (n.d.). *Date Duration Calculator — calendar arithmetic reference*. https://www.timeanddate.com/date/duration.html
  3. [3]International Organization for Standardization (ISO). (n.d.). *ISO 8601 — Date and time format*. https://www.iso.org/iso-8601-date-and-time-format.html
  4. [4]MDN Web Docs. (n.d.). *Date — JavaScript reference*. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
  5. [5]MDN Web Docs. (n.d.). *Date.prototype.getDay()*. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay
  6. [6]date-fns. (n.d.). *getISOWeek — modern JavaScript date utility library*. https://date-fns.org/v4.1.0/docs/getISOWeek
  7. [7]Office Holidays. (n.d.). *Public holidays by country*. https://www.officeholidays.com/

Last updated: October 19, 2026

1b

UnByte — Independent Software Engineering

Every calculator references authoritative sources — Editorial policy