The reason under the rule: computed

Basicity: Two Things the Rule Leaves Out

The rule: the more available the lone pair on nitrogen, the stronger the base. So piperidine is stronger than pyridine, and pyrrole, whose lone pair is part of the aromatic ring, is the weakest. The calculation confirms the order and shows two things the rule does not mention.

By Sunil Kumar. Updated 26 November 2026.

1017kJ/mol: piperidine, the strongest
969kJ/mol: pyridine
906kJ/mol: pyrrole, on carbon
818kJ/mol: pyrrole, on nitrogen

What was calculated

The basicity of a single molecule is its proton affinity: the energy released when it takes up in the gas phase. A larger number means a stronger base.

BaseWhere the proton goesProton affinity calculated (kJ/mol)Relative to ammonia, calculatedRelative to ammonia, measured
Pyrrolenitrogen818-70
Ammonianitrogen88800
Pyrrolecarbon 2906+18+22
Anilinenitrogen915+27+29
Pyridinenitrogen969+81+76
Piperidinenitrogen1017+129+100

The calculated values have no vibrational correction, so they lie about 35 to 60 kJ/mol above the measured proton affinities (ammonia: 854 measured). The differences between bases, in the last two columns, are what should be compared.

pyrrole (on N)818ammonia888pyrrole (on C2)906aniline915pyridine969piperidine1017Proton affinity in kJ/mol, calculated
Calculated gas phase proton affinities.

The main order

In piperidine the nitrogen is and its lone pair belongs to nitrogen alone, with three electron-releasing carbon groups around it. In pyridine the nitrogen is . Its lone pair lies in the plane of the ring, outside the aromatic system, but is held closer to the nucleus because an orbital has more s character. In pyrrole the lone pair is one of the six aromatic electrons. Putting a proton on that nitrogen destroys the aromatic ring, and the proton affinity falls 70 kJ/mol below ammonia.

First surprise: pyrrole takes the proton on carbon

When the proton is placed on carbon 2 instead, the proton affinity is 906 kJ/mol, 88 more than on nitrogen. The ring still loses its aromaticity, but the positive charge is now shared between nitrogen and two carbons through resonance. So pyrrole is a carbon base. It is still weak, and the textbook conclusion that pyrrole is the weakest of these is unchanged, but the site of protonation in most textbook drawings is not the one nature chooses.

Second surprise: aniline against ammonia

You learn that aniline is a weaker base than ammonia because its lone pair is delocalised into the benzene ring. In water this is true: the of aniline is 9.4 and of ammonia 4.75. But as single molecules, aniline has the higher proton affinity, by 27 kJ/mol calculated and 29 measured.

The delocalisation is real, and it does cost aniline some basicity. But the large ring is also easily polarised and helps carry the positive charge of the anilinium ion. In the gas phase the second effect wins. In water, the small ammonium ion forms four strong hydrogen bonds to water, while the anilinium ion forms three and has a large water-repelling ring. Solvation reverses the order. The textbook reason is correct but incomplete: the order in water is decided as much by the solvent as by the lone pair.

How this was calculated

Each molecule was treated alone, in the gas phase, with density functional theory (the B3LYP functional and the def2-TZVP basis set, with extra diffuse functions for negative ions), using the open source program PySCF. The shape of each molecule was first optimised, so the bond lengths and angles are results, not inputs. Energies are electronic energies without vibrational corrections. Values from other reliable methods differ a little, and the trends do not.

What is still open

Basicity in water cannot be read from the isolated molecule. The same reversal by solvent explains why the order of methyl amines in water, secondary above primary above tertiary, differs from the gas phase order.

Where this meets your syllabus

The ideas on this page start in chapters you study for JEE and NEET. Each link opens the chapter with its previous year questions.

Sources

Facts and figures are taken from the laboratories and the published results:

The explanation and the figures are made for students by MolSynapse. If you find an error, report it.

Read next