Pyrimidine is an organic compound, similar to benzene, but with a heterocyclic ring: two nitrogen atoms taking the place of carbon atoms at positions 1 and 3 relative to each other around the six-member ring.

Three bases of the nucleic acids, namely cytosine, thymine, and uracil, are pyrimidine derivatives. In DNA, these bases form hydrogen bonds with their complementary purines.

purine  pyrimidine

A T

G C

In RNA, the complement of A is U instead of T:

purine  pyrimidine

A U

G C

These hydrogen bonding modes are for classical Watson-Crick base pairing. Other hydrogen bonding modes are available in both DNA and RNA, although the additional 3'-hydroxyl group of RNA expands the configurations through which RNA can form hydrogen bonds.