In the Latin-based orthographies of many European languages, the letter ⟨g⟩ is used in different contexts to represent two distinct phonemes that in English are called hard and soft ⟨g⟩. The sound of a hard ⟨g⟩ (which often precedes the non-front vowels ⟨a o u⟩ or a consonant) is usually the voiced velar plosive [ɡ] (as in gangrene or golf) while the sound of a soft ⟨g⟩ (typically before ⟨i⟩, ⟨e⟩, or ⟨y⟩) may be a fricative or affricate, depending on the language. In English, the sound of soft ⟨g⟩ is the affricate /dʒ/, as in general, giant, and gym. A (g) at the end of a word usually renders a hard (g) (as in "dog"), while if a soft rendition is intended it would be followed by a silent (e) (as in "change").
This alternation has its origins in a historical palatalization of /ɡ/ which took place in Late Latin, and led to a change in the pronunciation of the sound [ɡ] before the front vowels [e] and [i]. Later, other languages not descended from Latin, such as English, inherited this feature as an orthographic convention. The Scandinavian languages, however, have undergone their shift independently.
In English orthography, the pronunciation of hard ⟨g⟩ is /ɡ/ and that of soft ⟨g⟩ is /dʒ/; the French soft ⟨g⟩, /ʒ/, survives in a number of French loanwords (e.g. regime, genre), [ʒ] also sometimes occurs as an allophone of [dʒ] in some accents in certain words.
In words of Greco-Latinate origin, the soft ⟨g⟩ pronunciation occurs before ⟨e i y⟩ while the hard ⟨g⟩ pronunciation occurs elsewhere. In some words of Germanic origin (e.g. get, give), loan words from other languages (e.g. geisha, pierogi), and irregular Greco-Latinate words (e.g. gynecology), the hard pronunciation may occur before ⟨e i y⟩ as well. The orthography of soft ⟨g⟩ is fairly consistent: a soft ⟨g⟩ is almost always followed by ⟨e i y⟩. The notable exceptions are gaol (now more commonly spelled jail) and margarine (a French borrowing whose original hard ⟨g⟩ softened for unknown reasons, even though the name Margaret has a hard ⟨g⟩). The soft pronunciation of algae, the only one heard in North America, is sometimes cited as an exception, but it is actually conformant, ⟨ae⟩ being an alternate spelling for a vowel in the ⟨e i y⟩ family. Though this pronunciation is listed first in some British dictionaries, hard pronunciation due to misinterpretation of the digraph ⟨ae⟩ is widespread in British English and is listed second or alone in some British dictionaries. In some words, a soft ⟨g⟩ has lost its trailing ⟨e⟩ due to suffixing, but the combination ⟨dg⟩ would automatically require the soft pronunciation anyway (e.g. fledgling, judgment, pledgor).
Digraphs and trigraphs, such as ⟨ng⟩, ⟨gg⟩, and ⟨dge⟩, have their own pronunciation rules.
While ⟨c⟩, which also has hard and soft pronunciations, exists alongside ⟨k⟩ (which always indicates a hard pronunciation), ⟨g⟩ has no analogous letter or letter combination which consistently indicates a hard ⟨g⟩ sound, even though English uses ⟨j⟩ consistently for the soft ⟨g⟩ sound (the rationale for the spelling change of "gaol" to "jail"). This leads to special issues regarding the "neatness" of orthography when suffixes are added to words that end in a hard-⟨g⟩ sound. This additionally leads to many words spelled with g⟨e i y⟩ and pronounced with a hard ⟨g⟩, including what may be the most common g⟨e i y⟩ word "get".
When suffixes are added to words ending with a hard or soft ⟨g⟩ (such as -ed, -ing, -er, -est, -ism, -ist, -edness, -ish(ness), -ily, -iness, -ier, -iest, -ingly, -edly, and -ishly), the sound is normally maintained. Sometimes the normal rules of spelling changes before suffixes can help signal whether the hard or soft sound is intended. For example, as an accidental byproduct of the rule that doubles consonants in this situation after a short vowel, a double ⟨gg⟩ will normally indicate the hard pronunciation (e.g. bagged is pronounced /ˈbæɡd/, not as /ˈbædʒd/).
There are occasional exceptions where alternations between the hard and soft sound occur before different suffixes. Examples are analogous (hard) vs. analogy (soft); similarly, prodigal with prodigy. These are generally cases where the entire word, including the suffix, has been imported from Latin, and the general Romance-language pattern of soft ⟨g⟩ before front vowels, but hard ⟨g⟩ otherwise, is preserved.
Sometimes a silent letter is added to help indicate pronunciation. For example, a silent ⟨e⟩ usually indicates the soft pronunciation, as in change; this may be maintained before a suffix to indicate this pronunciation (as in changeable), despite the rule that usually drops this letter. A silent ⟨i⟩ can also indicate a soft pronunciation, particularly with the suffixes -gion and -gious (as in region, contagious). A silent ⟨u⟩ can indicate a hard pronunciation in words borrowed from French (as in analogue, league, guide) or words influenced by French spelling conventions (guess, guest); a silent ⟨h⟩ serves a similar purpose in Italian-derived words (ghetto, spaghetti).
A silent ⟨e⟩ can occur at the end of a word – or at the end of a component root word that is part of a larger word – after ⟨g⟩ as well as word-internally. In this situation, the ⟨e⟩ usually serves a marking function that helps to indicate that the ⟨g⟩ immediately before it is soft. Examples include image, management, and pigeon. Such a silent ⟨e⟩ also indicates that the vowel before ⟨g⟩ is a historic long vowel, as in rage, oblige, and range. When adding one of the above suffixes, this silent ⟨e⟩ is often dropped and the soft pronunciation remains. While ⟨dge⟩ commonly indicates a soft pronunciation, the silent ⟨e⟩ may be dropped before another consonant while retaining the soft pronunciation in a number of words such judgment and abridgment. Also, the word veg, a clipped form of vegetate, retains the soft pronunciation despite being spelled without a silent ⟨e⟩ (i.e., pronounced as if spelled vedge). Similarly, soft ⟨g⟩ is sometimes replaced by ⟨j⟩ in some names of commercial entities, such as with "Enerjy Software", or "Majic 105.7" in Cleveland, Ohio and some names commonly spelled with ⟨j⟩ are given unusual soft ⟨g⟩ spellings such as Genna and Gennifer.
A number of two-letter combinations or digraphs follow their own pronunciation patterns and, as such, may not follow the hard/soft distinction of ⟨g⟩. For example, ⟨ng⟩ often represents /ŋ/ (as in ring) or /ŋɡ/ as in finger. The letters ⟨nge⟩, when final, represent /ndʒ/, as in orange; when not final their pronunciation varies according to the word's etymology (e.g. /ndʒ/ in danger, /ŋg/ in anger, /ŋ/ in banger). In most cases, ⟨gg⟩ represents /g/ as in dagger, but it may also represent /dʒ/ as in suggest and exaggerate. Other letter combinations that don't follow the paradigm include ⟨gh⟩, ⟨gn⟩, and ⟨gm⟩.
The digraph ⟨gu⟩ is sometimes used to indicate a hard ⟨g⟩ pronunciation before ⟨i e y⟩ (e.g. guess, guitar, Guinness), including cases where ⟨e⟩ is silent (rogue, intrigue, and, in Commonwealth spelling, catalogue and analogue). In some cases, the intervening ⟨u⟩ is pronounced as /w/ (distinguish, unguent).
All modern Romance languages make the hard/soft distinction with ⟨g⟩, except a few that have undergone spelling reforms such as Ladino (Judaeo-Spanish) or Haitian Creole and archaic variants like Sardinian. The hard ⟨g⟩ is [ɡ] in almost all those languages (with the exception of Galician, which may instead be a voiceless pharyngeal fricative), though the soft ⟨g⟩ pronunciation, which occurs before ⟨i e y⟩, differs amongst them as follows:
Different languages use different strategies to indicate a hard pronunciation before front vowels:
A soft pronunciation before non-front vowels is usually indicated by a silent ⟨e⟩ or ⟨i⟩ (e.g. Italian giorno, French mangeons), though Spanish, Portuguese, and Catalan use ⟨j⟩ as in jueves.
Several North Germanic languages also make a hard/soft distinction. Again, the hard ⟨g⟩ is [ɡ] in most of these languages, but the soft ⟨g⟩ differs as follows:
Icelandic orthography is a bit more complicated by having lenited pronunciations of ⟨g⟩.
In German, the g is mostly a hard g, also before e and i: geben (to give), Geld (money), Gier (greed), Gift (poison, venom). Soft g occurs in loanwoards, usually preserving the original pronunciation. So in words of French origin like Orange (orange), logieren (to lodge) or Etage (floor), the g is pronounced as [ʒ]; words taken from English like Gin or Gender use the /dʒ/-sound. However others, such as agieren (act, agitate), Generation (generation) or Gymnasium (academic high school), are pronounced with a hard g. Some pronunciations vary by region: The word Giraffe is pronounced with a soft G in Austria, but with a hard G in Germany. The g in Magnet is pronounced as a hard g, but the gn in Champagner is pronounced like the French gn in champagne. The letter combination ng is usually merged to a velar nasal, and the g is not spoken in its own right; e.g., in the German word Finger, it is not audible as in the English word finger. However, when those letters are pronounced separately, as in compound words like Eingabe (input) or also in verbs like fingieren (to feign), both the n and the hard g is clearly audible. There are exceptions in loanwords like French-derived rangieren (to rank, to shunt), spoken with a velar nasal and a soft g ([ʒ]).
Other languages typically have hard ⟨g⟩ pronunciations except possibly in loanwords where it may represent [ʒ] or [dʒ].
The orthography of Luganda is similar to Italian in having a soft ⟨g⟩ pronunciation before front vowels (namely ⟨i y⟩) and ⟨gy⟩ indicates this soft pronunciation.
The Vietnamese alphabet does not have a hard or a soft ⟨g⟩ per se. However, since it was inherited from European Romance languages (Portuguese and Italian) except the diacritics which were from Greek; the letter ⟨g⟩ never occurs in "soft positions", i.e. before ⟨e⟩, ⟨ê⟩ and ⟨i⟩ where the digraph ⟨gh⟩ (colloquially known as gờ ghép "composed ⟨g⟩") is used instead. Likewise, the trigraph ⟨ngh⟩ (ngờ ghép "composed ⟨ng⟩") also replaces the digraph ⟨ng⟩ in those positions. "gh" can be explained as following Italian convention, and "ngh" as a form of analogy. However, there still is ⟨gi⟩ which is considered a digraph on its own, even in the word gì.
In Modern Greek, which uses the Greek alphabet, the Greek letter gamma (uppercase: ⟨Γ⟩; lowercase: ⟨γ⟩) – which is ancestral to the Roman letters ⟨g⟩ and ⟨c⟩ – has "soft-type" and "hard-type" pronunciations, though Greek speakers do not use such a terminology. The "soft" pronunciation (that is, the voiced palatal fricative [ʝ]) occurs before ⟨αι⟩ and ⟨ε⟩ (both which represent [e]), and before ⟨ει⟩, ⟨η⟩, ⟨ι⟩, ⟨οι⟩, and ⟨υι⟩ (which all represent [i]). In other instances, the "hard" pronunciation (that is, the voiced velar fricative [ɣ]) occurs.
In the Russian alphabet (a variant of Cyrillic), ⟨г⟩ represents both hard (твёрдый [ˈtvʲo.rdɨj]) and soft (мягкий [ˈmʲæ.xʲkʲɪj]) pronunciations, [ɡ] and [ɡʲ], respectively. The soft pronunciation of ⟨г⟩ occurs before any of the "softening" vowels ⟨е ё и ю я ь⟩ and the hard pronunciation occurs elsewhere. However, the letter ⟨ж⟩ functions as a "soft g" in the Romance sense, with alterations between ⟨г⟩ and ⟨ж⟩ common in the language (e.g. ложить, "to lie (down)", past tense лёг; подруга, "girlfriend", diminutive подружка). In other Slavic languages, there are similar phenomena involving ⟨g⟩ (or ⟨h⟩) and ⟨ž⟩ (or ⟨ż⟩).
In Modern Hebrew, which uses the Hebrew alphabet, the letter gimel (⟨ג⟩) typically has the [ɡ] sound within Hebrew words, although in some Sephardic dialects, it represents [ɡ] or [dʒ] when written with a dagesh (i.e., a dot placed inside the letter: ⟨גּ⟩), and [ɣ] when without a dagesh. An apostrophe-like symbol called a Geresh can be added immediately to the left of a gimel (i.e., ⟨ג׳⟩) to indicate that the gimel represents an affricate /d͡ʒ/).