Diglossia is a linguistic situation in which two (often very closely related) languages are used within one speech community, for different purposes. This often means that one of them is used as colloquial language in everyday life, while the other is mainly used in its written form and thereby often has more prestige as well.
A textbook example of diglossia is the relationship between the German dialects of Switzerland. Standard Swiss German is very similar to the standard varieties in other German-speaking countries; is learned at school by German Swiss people; and is used for writing, some broadcasting, and very formal situations. By contrast, the local variety of Swiss German in a given area is the language of everyday life, although it can be written and is being increasingly found in situations where previously Standard German would have been used, such as the classroom. The two are not mutually intelligible, so speakers of German from outside Switzerland often find Swiss German difficult to understand.
Diglossia is difficult to define or identify in some linguistic situations. One example involves Spanish and Guaraní in Paraguay. Unlike Swiss and Standard German, the two languages are unrelated, Guaraní being a Tupian language of South America and Spanish being Indo-European. Another difference is that both languages are politically recognised in Paraguay. Yet another is that not all Paraguayans speak both languages. Nevertheless, those who are bilingual may use the languages for different purposes, in situations where one rather than the other is appropriate, so Paraguay is sometimes recognised in linguistics literature as host to a diglossic situation.
Arabic in various countries is also seen as a diglossic or even triglossic situation. Two or three varieties of Arabic, often alongside other languages, are used for different purposes. The differences between these forms of Arabic are considerable.
Situations of diglossia are especially interesting for sociolinguists, who study the different ways a language is used in diverging situations.