Flag of San Marino

The flag of San Marino is formed by two equal horizontal bands of white (top) and light blue with the national coat of arms superimposed in the center; the coat of arms has a shield (featuring three towers on three peaks) with a closed crown on top, flanked by an oak and laurel wreath, with a scroll below bearing the word LIBERTAS (Freedom). The two colors of the flag represent peace (white) and liberty (light blue).

Although the Law on the flag and coat of arms of San Marino from 2011 refers only to the "official flag" of the republic, a de facto civil flag, which omits the coat of arms, can sometimes be seen flying. Some official sources of San Marino suggest that the civil flag is actually the bicolor with the coat of arms of the specific city it is used in, instead of the national one.

The national ensign of San Marino is identical to the state flag.

San Marino's municipalities all have flags that are very similar to San Marino's national flag. These flags all contain a shield-like emblem on the horizontal white and blue bicolor. Closest to the hoist of these flags is the name of the municipality written vertically.

History
The oldest attested standard of the republic dates back from 4 September 1465, when it was commissioned from a manufacturer in Florence, allegedly composed of a tricolour of gold, white and "alessandrino" (thought to be purple, recently re-interpreted as a shade of azure).

In 1797, most likely influenced by the wave of reforms in France, the Supreme Council of the Republic commissioned a white and blue cockade, which, coincidentally or not, was identical to the one used by the French revolutionaries.

The decree of 6 April 1862 standardized the coat of arms, but did not mention the flag.

Proportions and colors
The official proportion of the flag is 3:4, the coat of arms' width being $3/8$ of the flag's length. While the arms are horizontally centered, their vertical position on the flag is defined by the location of the center of the cross on top of the crown: at $1/8$ of the flag's length. The proportion of the coat of arms is 5:6.

A 2:3 proportion can be used internationally and/or when specifically requested. In this case, the coat of arms' width is $1/3$ of the flag's length, and the center of the cross on the top of the crown will be at $1/6$ of the flag's height below the upper edge.

The colors of the flag are officially prescribed as follows:

Municipalities ("Castles")
Castles have their own flag, as indicated by March 28th 1997 decree n°40. Article 2 demands each name to be indicated vertically at the hoist in peigmot font, but it is not enforced and it is usual see hoisted unnamed flags at public offices.