Acetonitrile (CH₃−C≡N) is a weak base due to the electron-withdrawing effect of the nitrile group (-CN). The nitrogen atom in the nitrile group is sp hybridized, making it less basic than a nitrogen atom with more s character.
Pyridine is a weak base because the lone pair of electrons on the nitrogen atom is delocalized within the aromatic ring, making it less available for protonation. The nitrogen atom in pyridine is sp² hybridized, making it more basic than acetonitrile.
Pyrimidine, with two nitrogen atoms in the ring, is more basic than pyridine. The electron-withdrawing effect of the second nitrogen atom is less significant due to resonance within the ring. Both nitrogen atoms in pyrimidine are sp² hybridized.
Overall basicity order:
Pyrimidine > Pyridine > Acetonitrile