The chemical linking of two complementary nitrogenous bases in DNA and in certain types of RNA molecules. Of the four such bases in DNA, adenine pairs with thymine and cytosine with guanine. In RNA, thymine is replaced by uracil. Base pairing is responsible for holding together the two strands of a DNA molecule to form a double helix and for faithful reproduction and reading of the genetic code. The links between bases take the form of hydrogen bonds. See also wobble.