Both DNA and RNA have a backbone made of phosphate groups to which the bases are attached. Additionally, both DNA and RNA are made up nucleotides. They each contain four types of nitrogenous bases. DNA and RNA can form regions where complementary base pairing occurs, leading to the formation of double-stranded structures. Both DNA and RNA molecules can fold into secondary structures. These structures, such as hairpins, loops, and stem-loop structures, are formed due to complementary base pairing within the same molecule.