What this calculator does
See any month as a calendar, laid out week by week the way it hangs on a wall. You might want to check a month far in the future, or look back at the month you were born. Or you may just need to know how many working days a month has. Pick a year and a month, and the grid appears right away.
Along with the grid, you get the number of days in the month and the weekdays it starts and ends on. You also get how many of its days are Monday to Friday and how many fall on a weekend. It tells you whether the year is a leap year, and which days of the year the month covers. The steps show how to work out the first weekday by hand.
Where it's used
Why this math matters outside the classroom:
- Planning a month. A parent sets the February 2024 grid beside the school schedule and sees February 29 falls on a Thursday.
- Counting workdays. An office manager sees January 2027 has 21 weekdays and 10 weekend days before holidays are taken out.
- Project schedules. A team on ISO weeks sees that Monday, January 4, 2027 starts week 1, and the week of December 28 is week 53.
- Classroom remainders. Students find February 1, 2024 by working out 32 mod 7 = 4 and counting 4 days on from Sunday to Thursday.
- Leap-year checks. A student checks that February 2000 had 29 days, since 2000 divides evenly by 400, while February 1900 had 28.
How to use it
- Type the year, from 1583 to 9999. It starts at 2027.
- Pick the month from the list.
- Choose whether weeks start on Sunday, as on most US calendars, or on Monday. Monday adds a column of ISO week numbers.
- Read the grid and the month facts. Open the steps to see how the first weekday and the length of February are found.
What the inputs mean
- Year
- The calendar starts at 1583, the first full year of the Gregorian calendar (the calendar most of the world uses today). Earlier years used other calendars in many places, so a grid for them could mislead.
- Week starts on
- This only moves the columns. The dates and counts stay the same. With Monday first, each row also shows its ISO week number. ISO is the international standard where weeks run Monday to Sunday, and week 1 is the week with the year's first Thursday.
Formula and method
Weekday of January 1 = (1 + 5 × (P mod 4) + 4 × (P mod 100) + 6 × (P mod 400)) mod 7, where P = year − 1 Weekday of the 1st of the month = (weekday of January 1 + days in the months before it) mod 7 0 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday Leap year: divides evenly by 4, except century years, which must also divide evenly by 400 Weekdays in the month = 4 × 5 + the weekdays among the 0 to 3 days past four full weeks
P is the year before the one you picked. "mod" means the remainder after dividing. So "P mod 4" is what's left when you divide P by 4.
The first line is a rule from the mathematician Carl Friedrich Gauss. Each ordinary year has 365 days, which is 52 weeks and 1 day. So each year pushes January 1 one weekday later, and a leap year pushes it two. The three remainders keep track of how many leap days came before, including the century rule.
Once you know January 1, the rest is counting. Add the days in the months before your month, divide by 7 and keep the remainder. That remainder moves you forward from January 1's weekday. The week repeats every 7 days, so whole weeks don't matter.
February is the only month whose length changes. It has 29 days in a leap year and 28 otherwise. A leap year divides evenly by 4. Century years such as 1900 are the exception: they are leap years only if they also divide evenly by 400. That's why 2000 was a leap year but 1900 was not.
Every month has four full weeks, which hold 20 weekdays. The 0 to 3 days left over add a weekday each unless they land on a Saturday or Sunday.
Worked example
What does February 2024 look like?
- P = 2023, so the remainders are 3, 23 and 23. Then (1 + 5 × 3 + 4 × 23 + 6 × 23) mod 7 = 246 mod 7 = 1. So January 1, 2024 was a Monday.
- 2024 divides evenly by 4 and isn't a century year, so it is a leap year. February has 29 days.
- January has 31 days, so (1 + 31) mod 7 = 32 mod 7 = 4. February 1 was a Thursday.
- February covers days 32 to 60 of the year. February 29 lands on a Thursday too.
- Four full weeks give 20 weekdays. The one extra day is a Thursday, which adds 1, so there are 21 weekdays and 8 weekend days.
- With Monday first, the grid has five rows, ISO weeks 5 to 9.
Result: February 2024 has 29 days, running from Thursday, February 1 to Thursday, February 29. It has 21 weekdays and 8 weekend days, and covers days 32–60 of the year.
Understanding the result
Blank cells in the grid belong to the month before or after. They are left empty so each date sits under its own weekday.
Weekdays here means Monday to Friday. Public holidays are not taken out, because they differ by country and change over time. Subtract any holidays yourself to get working days.
A month can fill four, five or six rows. Only a 28-day February that starts on the first column fits in four.
Near New Year, an ISO week number may belong to the year before or after. For example, the week of Monday, December 30, 2024 is week 1 of 2025.
Assumptions and limitations
- All dates are on the Gregorian calendar.
- The weekend is Saturday and Sunday.
- No holidays, events or moon phases are shown.
- Years before 1583 and after 9999 aren't supported.
- Some countries switched to the Gregorian calendar long after 1583. For those, grids for early years won't match the calendar people used then.
Frequently asked questions
Do calendars repeat from year to year?
Yes. A year's calendar matches an earlier one when both start on the same weekday and both are, or aren't, leap years. For example, 2027 uses the same calendar as 2021. The whole pattern repeats every 400 years.
Why do some calendars start the week on Monday?
Many countries count Monday as the first day of the week. The ISO standard does too. US calendars usually start on Sunday. The dates are the same either way.
How many working days are in a month?
Every month has 20 to 23 weekdays. The exact count depends on which weekday the month starts on. Take out any public holidays to get the days you'd actually work.
What is a week number?
It's a way to name each week of the year by number, from 1 to 52 or 53. Offices and factories often plan by week number. Pick a Monday start to see the ISO week number on each row.
How this calculator is checked
Method: Gauss's rule for the weekday of January 1, plus the days in the preceding months; Gregorian leap-year rule; ISO 8601 week numbering (week of the Thursday). Cross-checked in tests against a day count from January 1, 1970 for every year 1583–9999. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-26. Found a problem? Tell us.
Embed this calculator
Put this Calendar Generator on your own website or blog for free. Paste this code where you want it to appear: