Five-membered aromatic heterocycles: pyrrole, furan and thiophene
In pyrrole, furan and thiophene, the heteroatom contributes a pair of electrons to the π system: six electrons shared among five atoms. They are π-excessive heterocycles, much more reactive than benzene towards electrophiles, which preferentially attack C2. Their aromaticity, lower than that of benzene, decreases in the order thiophene > pyrrole > furan.
Structure and aromaticity
The four carbons contribute one π electron each, and the heteroatom a lone pair, which is thus no longer available: pyrrole is not basic at nitrogen. Oxygen, being very electronegative, gives up its pair reluctantly, and furan is the least aromatic of the three; sulfur, less electronegative and more polarizable, makes thiophene the most benzene-like. Review heteroaromatic compounds and aromaticity in Organic Chemistry made transparent.

The low aromaticity of furan shows in its reactivity: it acts as a diene in the Diels–Alder reaction (with maleic anhydride it gives the exo adduct) and in aqueous acid it opens to 1,4-dicarbonyl compounds, the reverse of the Paal–Knorr synthesis. The NH of pyrrole is weakly acidic (pKa ≈ 17.5) and can be deprotonated with NaH or butyllithium to alkylate the nitrogen.
Electrophilic substitution
Pyrrole reacts with electrophiles as fast as a phenoxide or an aniline, and the order of reactivity is pyrrole > furan > thiophene ≫ benzene. Attack takes place at C2 because the resulting σ-complex spreads the positive charge over three atoms, one of them the heteroatom; attack at C3 allows only two resonance forms. Review the SEAr mechanism.

This very reactivity calls for mild reagents. Strong acids protonate pyrrole and furan at C2 and polymerize them, and halogens give polyhalogenated products: pyrrole and bromine give 2,3,4,5-tetrabromopyrrole. Instead of the nitric–sulfuric acid mixture, acetyl nitrate is used; instead of aluminium chloride, anhydrides with weak Lewis acids, or the Vilsmeier–Haack formylation.

Metallation
Butyllithium removes the C2 proton of furan and thiophene, which is more acidic than the others owing to the nearby heteroatom. The 2-lithio derivatives react with electrophiles or are converted into boronic acids and stannanes for cross-couplings. Pyrrole is first protected on nitrogen (with Boc or a phenylsulfonyl group) so that it can be lithiated at C2. Thiophene is so stable that it appears in many drugs as a replacement for benzene (a bioisostere).
Pyrrole was isolated from coal tar in 1834 by Friedlieb Ferdinand Runge. Four pyrrole rings linked by methine bridges form the porphyrins of haem and chlorophyll.