DNA and RNA are both essential components of cells, and thus life. The structure of DNA is similar to that of RNA in that these are both made of nucleotides, which in turn are made of the same basic units: a phosphate group, a pentose sugar, a nitrogenous base. The pentose sugars differ between DNA and RNA - DNA has deoxyribose (missing OH group on 2' carbon) while RNA has ribose (has OH group on 2' carbon). Both DNA and RNA nucleotides have one of four possible nitrogenous bases, two of which are pyrimidines and two which are purines. Both DNA and RNA can have cytosine, adenine and guanine as nitrogenous bases - however RNA has uracil as its final base while DNA has thymine. Structurally, single strands of DNA and RNA are similar as nucleotides are linked together by covalent, phosphodiester bonds created between the 5' phosphate group of one nucleotide and the 3' hydroxyl (OH) group of another. However, DNA is typically found in a double-helix format which is antiparallel while RNA is typically found as single-stranded.
RNA and DNA also differ in their functionality. DNA is the means by which all genetic information is stored within the cells, and propagation by semi-conservative replication can allow for the genesis of new cells (meiosis, mitosis) or organisms (fusion of haploid gametes). Thus, DNA is only found in the nucleus and mitochondria where it is super-condensed into chromatin and then organized into chromosomes. By contrast, RNA is created by the process of transcription and enables the process of translation - the expression of genetic information in the form of proteins. This happens in two ways: strands of mRNA code for differing sequences of amino-acids - which form proteins - via the codon code, and some RNA can form translation machinery (ribosomes, tRNA) via secondary double-stranded structures. In the latter case, RNA complementary base-pairing differs to DNA pairing as uracil - instead of thymine - now pairs with adenine.