A phoneme is the smallest unit of sound that can distinguish one word from another in a particular language. It is best understood as a set of similar sounds that native speakers treat as a single sound because, in their language, the differences among them never change meaning. The English words cell and set differ only in their final sound, and that difference alone creates two words; /l/ and /t/ are therefore phonemes of English. Phonemes are written between slashes, such as /p/, while the actual sounds produced, called phones, are written in square brackets, such as [pʰ].
The phoneme has three essential characteristics. First, it is contrastive: its function is to keep words apart. Second, it is abstract. No two pronunciations of a sound are identical, and one phoneme may be realised by different phones in different positions. The aspirated [pʰ] of pin and the unaspirated [p] of spin are both realisations, or allophones, of the single phoneme /p/. Third, it is language-specific. Aspiration is predictable in English but distinguishes words in Icelandic and Hindi, so the same pair of sounds counts as one phoneme in English and two in those languages. Edward Sapir made this point in 1921 by observing that the difference between the t of time and the t of sting has no value for an English speaker but is meaningful in Haida.
Phonemes are units of sound, not spelling. Knot, nut and gnat contain the same consonant phonemes /n/ and /t/ and differ only in their vowels, while three has five letters but three phonemes, /θ/, /r/ and /iː/. The analysis of phonemes therefore begins from transcription.
The principal method of establishing phonemes is the minimal-pair, or commutation, test. Two sounds are separate phonemes if substituting one for the other in the same position changes the meaning. English initial consonants contrast in pin and bin or rot and lot; vowels in bin and bean, pet and pat, wood and wooed; final consonants in hat and had, sin and sing, teeth and teethe. The pair sin and sing shows that /n/ and /ŋ/ are distinct phonemes in English, even though Spanish speakers hear them as variants of one sound. Where no exact pair exists, a near-minimal pair such as pressure and pleasure demonstrates the contrast between /ʃ/ and /ʒ/.
Two further criteria complete the analysis. Sounds that never occur in the same environment are in complementary distribution and are usually allophones of one phoneme. Yet distribution is not sufficient: English [h] occurs only at the start of syllables and [ŋ] only at the end, but they are so unlike phonetically that they are counted as separate phonemes. Phonetic similarity is thus the second requirement.
By these methods English is usually analysed as having 24 consonant phonemes and, in traditional RP, 20 vowel phonemes, a total of 44. Stress can also distinguish words, as in the noun and verb invite, and is therefore a suprasegmental feature with a phonemic function.
In conclusion, the phoneme is the basic unit of phonology: an abstract, contrastive and language-specific unit, established by minimal pairs together with distribution and phonetic similarity.