Very often flags are used as symbols of languages, on the Web and elsewhere. For instance, a Web page might contain an "English flag" which acts as a link to an English version of a document (which itself is in another language). It is usually bad practice to use images as anchors of links, but this document concentrates on the theme why flags are particularly unsuitable anchors.
In a perfect world, there would be no need for explicit links to versions of a document in different languages. Even in this imperfect world, the Web might evolve so that a server and a user agent smoothly select a version according to language preferences which the user has given when configuring the browser. (There are methods for such negotation in the HTTP protocol, but they are rarely used in practice so far. See Techniques for multilingual Web sites. This should not be confused with the misguided "forced redirection" e.g. by Google, which uses undisclosed heuristics to send the user to a page in a particular language.)
Probably the most common motivation for using a flag as a language symbol is that it is expected to catch the eye better than text does.
I'm not arguing against that expectation, and I'm not preaching against eye-catching images in general; see my article How to use images in communication in general and on the Web in particular. I'm not even going to discuss the question whether it makes sense to draw every reader's attention to a flag. (Why should I care about a link to a German version in a document written in a language which I know quite well, especially if I don't know German?) But I will present arguments which speak against flags as language symbols much stronger than any arguments about eye-catching or esthetics can speak in favor of it.
Fundamentally, a flag is a symbol of a country. It could also be a symbol of an administrative area or a society or organization or movement, but such flags are not used as symbols of languages, with rare exceptions like Esperanto.
Naturally one could use a flag a symbol for the country e.g. in a list of links to information related to various countries. Whether it is wise to do so depends on the context. Typically people know names of countries better than their flags, so usually a flag isn't such a great symbol communicatively. What we discuss here is the use of flags for languages, and such usage is plain wrong.
There is no one-to-one mapping between countries and languages. Even in the rare cases where the native speakers of a language and the citizens of a country are almost identical groups, there is no reason to bind the country and the language strictly together.
Why should, for example, a Brasilian select the flag of Portugal to select his native language? It's quite possible that a Brasilian does not even know the flag of Portugal.
Suppose that you were born in Finland and your forefathers lived there for centuries and that your native language is Swedish. Why should you need to select the national flag of Sweden (a country that you maybe never even visited) in order to read some material in your native language? Such use of flags could be taken as an insult, since loyalty to a flag is loyalty to the country that it symbolizes. And in practical terms, the flag of Sweden on a Web page of an organization in Finland would most logically refer to related pages in Sweden; and such links would often be very useful, since the countries have so many cultural ties.
As an important special case, consider the flag which is probably the most commonly used as a symbol of language. The British Union Flag (often called Union Jack) is often used to denote the English language, and sometimes even called "the English flag". First, it needs to be noted that it is not the flag of England but of the United Kingdom of Great Britain and Northern Ireland. There is a flag of England, but few people outside the United Kingdom know it, except perhaps as a football team symbol. More importantly, the majority of people who know English - or even the majority of people who speak English as their native language - do not live in the United Kingdom. People who put the Union Flag into their documents to symbolize English rarely think about this, and neither do they think whether their document is actually in British English instead of e.g. American (US) English.
In many countries, the Union Flag refers to previous colonial masters. Thus, a flag used as a language symbol may have unwanted connotations (in addition to being misleading as regards to its denotation). Even if the associated feelings are positive, there is no reason to raise them, when the communicative purpose is just to refer to some information written in the English language.
The blog Flags are not languages presents good examples of problems like the use of the flag of the Arabic League to symbolize the Arabic language and the effect of changes of flags.
The use of national flags to denote language, although convenient to implement, is another potential source of major irritation to the users, particularly for native speakers of the language outside the thus indicated country.
On international and multilingual pages, flags in menus cause great confusion: they would logically denote countries (leading to country-specific information, in some language) and they often do, but probably more often they refer to languages (typically leading to the same information in different languages).
An image, even a small one, takes more time to transfer over network than the alternatives discussed below. This means that the flag images might appear on the screen only after the text of the document is there. Such behavior looks odd, since it is contrary to the idea of providing fast and comfortable access to versions of a document in different languages.
Very often images of flags are of poor quality as regards to proportions, colors, and form. A flag image of reasonable quality might require a large image file, making the above-mentioned performance problem more serious. Images of flags might even be deliberately distorted to achieve a "cool" effect, such as presenting a rectangular flag as a round button. A flag of any country should be treated with respect; insulting a flag insults the country and its people.
An image serves a communicative purpose only if the user can see the image. There are several reasons why this might fail. In Web documents, an image can (and should) be accompanied with an alternative textual presentation of the same information, the so-called ALT attribute of an IMG element. For languages, this is easy, but then you can in fact ask what you need the image for in the first place.
There is a perfect symbol for any language which you can use on the Web: the name of the language in the language itself, such as English (or British English or US English, if needed). Be careful with the grammatically correct use of upper and lower case here! If a reader doesn't know the name of language X in X, he probably does not know X enough for the link to be of use to him.
If you need something shorter (you don't actually need on the Web, but you might need when designing e.g. id cards for employees), you can use the codes defined in the international standard ISO 639, either the two-letter codes of ISO 639-1, such as en for English, or the three-letter codes of ISO 639-2, like eng for English. Both types of codes are listed on the ISO 639-2 Registration Authority pages. The three-letter codes might be regarded as more informative and more understandable to the speakers of the languages. They are also more suitable if you expect that less common languages, which may have no two-letter code, will be included into the language repertoire. However, two-letter codes are so often used on Web pages and elsewhere that many people are familiar with them.
However, it is unwise to try to control the presentation too much. For example, some Web pages of the European Union (EU), such as an old version of the basic search page, languages were symbolized correctly by using ISO 639 codes but so that the letters are presented as colored images. This raised the irritating question whether the use of different colors for different languages carries a message – intentionally or unintentionally. The current main page of the EU has a balanced presentation of the different languages.
In many cases, there is no need to use any symbol for a language. If you have a link with anchor text in English (like Flag as a symbol of language – stupidity or insult?), isn't it pretty obvious that it refers to a document written in English? And if you have the home page of a company or an association in several languages, isn't it pretty natural to list its names in those languages, making each name a link to a version of the document in that language?
Several examples and arguments in this document have been taken from a news article (in Finnish) by Jarkko Hietaniemi.