A nucleobase (or simply base) is the component of a deoxyribonucleotide (in DNA) or ribonucleotide (in RNA) that is involved in complementary pairing. The most common bases are adenine, cytosine and guanine (in DNA and RNA), thymine (in DNA only) and uracil (in RNA only). Less common nucleobases include xanthine and hypoxanthine (the result of deaminations of guanine and adenine, respectively) and pseudouridine.

Nucleobases may chemically be divided into one of two groups: cytosine, thymine and uracil are
pyrimidines, heterocylic compounds containing two nitrogen atoms; while adenine and guanine are purines, consisting of a pyrimidine ring fused to an imidazole ring. Pyrimidines and purines bond (via hydrogen bonding) in complementary pairs:
  • Adenine to either thymine (DNA) or uracil (RNA) with 2 hydrogen bonds;
  • Cytosine to guanine with 3 hydrogen bonds.

The unique sequence of nucleobases in DNA is what gives each molecule of DNA its unique coding capacity.

Nucleobases are produced organically via a range of biosynthetic pathways, often using amino acids as their precursors.