An image showing which century years are leap years in the Gregorian calendar.
In the Gregorian calendar, the standard calendar in most of the world, most years that are multiples of 4 are leap years. In each leap year, the month of February has 29 days instead of 28. Adding one extra day in the calendar every four years compensates for the fact that a period of 365 days is shorter than a
tropical year by almost 6 hours.
 Some exceptions to this basic rule are required since the duration of a tropical year is slightly less than 365.25 days. The
Gregorian reform modified the Julian calendar's scheme of leap years as follows:
Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100, but these centurial years are leap years if they are exactly divisible by 400. For example, the years 1700, 1800, and 1900 were not leap years, but the years 1600 and 2000 were.
Over a period of four centuries, the accumulated error of adding a leap day every four years amounts to about three extra days. The Gregorian calendar therefore removes three leap days every 400 years, which is the length of its leap cycle. This is done by removing February 29 in the three century years (multiples of 100) that cannot be exactly divided by 400.
 The years 1600, 2000 and 2400 are leap years, while 1700, 1800, 1900, 2100, 2200 and 2300 are common years. By this rule, the average number of days per year is 365 + 1⁄4 − 1⁄100 + 1⁄400 = 365.2425.
 The rule can be applied to years before the Gregorian reform (the
proleptic Gregorian calendar), if
astronomical year numbering is used.
This graph shows the variations in date and time of the
June Solstice due to unequally spaced "leap day" rules. Contrast this with the Iranian
Solar Hijri calendar, which generally has 8 leap year days every 33 years.
The Gregorian calendar was designed to keep the
vernal equinox on or close to March 21, so that the date of
Easter (celebrated on the Sunday after the ecclesiastical
full moon that falls on or after March 21) remains close to the vernal equinox.
 The "
Accuracy" section of the "
Gregorian calendar" article discusses how well the Gregorian calendar achieves this design goal, and how well it approximates the
pseudocode determines whether a year is a leap year or a common year in the Gregorian calendar (and in the proleptic Gregorian calendar before 1582). The year variable being tested is the integer representing the number of the year in the Gregorian calendar, and the tests are arranged to dispatch the most common cases first. Care should be taken in translating mathematical integer divisibility into specific programming languages.
if (year is not
divisible by 4) then (it is a common year)
else if (year is not divisible by 100) then (it is a leap year)
else if (year is not divisible by 400) then (it is a common year)
else (it is a leap year)
A Swedish pocket calendar from 2008 showing February 29
February 1900 calendar showing that 1900 was not a leap year
February 29 is a date that usually occurs every four years, and is called leap day. This day is added to the calendar in leap years as a corrective measure, because the Earth does not orbit the sun in precisely 365 days.
The Gregorian calendar is a modification of the
Julian calendar first used by the Romans. The
Roman calendar originated as a lunisolar calendar and named many of its days after the
syzygies of the moon: the new moon (Kalendae or calends, hence "calendar") and the full moon (Idus or ides). The Nonae or nones was not the first
quarter moon but was exactly one nundina or Roman market week of nine days before the ides, inclusively counting the ides as the first of those nine days. This is what we would call a period of eight days. In 1825,
Ideler believed that the lunisolar calendar was abandoned about 450 BC by the
decemvirs, who implemented the
Roman Republican calendar, used until 46 BC. The days of these calendars were counted down (inclusively) to the next named day, so February 24 was ante diem sextum Kalendas Martias ("the sixth day before the calends of March") often abbreviated a. d. VI Kal. Mart.
The Romans counted days inclusively in their calendars, so this was actually the fifth day before March 1 when counted in the modern exclusive manner (not including the starting day).
The Republican calendar's intercalary month was inserted on the first or second day after the
Terminalia (a. d. VII Kal. Mar., February 23). The remaining days of Februarius were dropped. This intercalary month, named Intercalaris or
Mercedonius, contained 27 days. The religious festivals that were normally celebrated in the last five days of February were moved to the last five days of Intercalaris. Because only 22 or 23 days were effectively added, not a full lunation, the calends and ides of the Roman Republican calendar were no longer associated with the new moon and full moon.
The Julian calendar, which was developed in 46 BC by
Julius Caesar, and became effective in 45 BC, distributed an extra ten days among the months of the Roman Republican calendar. Caesar also replaced the intercalary month by a single intercalary day, located where the intercalary month used to be. To create the intercalary day, the existing ante diem sextum Kalendas Martias (February 24) was doubled, producing ante diem bis sextum Kalendas Martias. Hence, the year containing the doubled day was a bissextile (bis sextum, "twice sixth") year. For legal purposes, the two days of the bis sextum were considered to be a single day, with the second half being intercalated; but in common practice by 238, when
Censorinus wrote, the intercalary day was followed by the last five days of February, a. d. VI, V, IV, III and pridie Kal. Mart. (the days numbered 24, 25, 26, 27, and 28 from the beginning of February in a common year), so that the intercalated day was the first half of the doubled day. Thus the intercalated day was effectively inserted between the 23rd and 24th days of February. All later writers, including
Macrobius about 430,
Bede in 725, and other medieval
computists (calculators of Easter), continued to state that the bissextum (bissextile day) occurred before the last five days of February.
In the older
, feast days falling on or after February 24 are celebrated one day later in leap year.
Until 1970, the
Roman Catholic Church always celebrated the feast of
Saint Matthias on a. d. VI Kal. Mart., so if the days were numbered from the beginning of the month, it was named February 24 in common years, but the presence of the bissextum in a bissextile year immediately before a. d. VI Kal. Mart. shifted the latter day to February 25 in leap years, with the
Vigil of St. Matthias shifting from February 23 to the leap day of February 24. This shift did not take place in pre-Reformation Norway and Iceland;
Pope Alexander III ruled that either practice was lawful (
, 5. 40. 14. 1). Other feasts normally falling on February 25–28 in common years are also shifted to the following day in a leap year (although they would be on the same day according to the Roman notation). The practice is still observed by those who use the older calendars.
Synchronized calendars (Bengali, Indian and Thai)
Bengali Calendar of Bangladesh and the
Indian National Calendar organise their leap years so that the every leap day is close to a February 29 in the Gregorian calendar and vice versa. This makes it easy to convert dates to or from Gregorian.
Thai solar calendar uses the
Buddhist Era (BE), but has been synchronized with the Gregorian since