<P> Nucleobases, also known as nitrogenous bases or often simply bases, are nitrogen - containing biological compounds that form nucleosides, which in turn are components of nucleotides, with all of these monomers constituting the basic building blocks of nucleic acids . The ability of nucleobases to form base pairs and to stack one upon another leads directly to long - chain helical structures such as ribonucleic acid (RNA) and deoxyribonucleic acid (DNA). </P> <P> Five nucleobases--adenine (A), cytosine (C), guanine (G), thymine (T), and uracil (U)--are called primary or canonical . They function as the fundamental units of the genetic code, with the bases A, G, C, and T being found in DNA while A, G, C, and U are found in RNA . Thymine and uracil are identical excepting that T includes a methyl group that U lacks . </P> <P> Adenine and guanine have a fused - ring skeletal structure derived of purine, hence they are called purine bases . Similarly, the simple - ring structure of cytosine, uracil, and thymine is derived of pyrimidine, so those three bases are called the pyrimidine bases . Each of the base pairs in a typical double - helix DNA comprises a purine and a pyrimidine: either an A paired with a T or a C paired with a G. These purine - pyrimidine pairs, which are called base complements, connect the two strands of the helix and are often compared to the rungs of a ladder . The pairing of purines and pyrimidines may result, in part, from dimensional constraints, as this combination enables a geometry of constant width for the DNA spiral helix . The A-T and C-G pairings function to form double or triple hydrogen bonds between the amine and carbonyl groups on the complementary bases . </P>

Adenine guanine cytosine and thymine are the four in dna