1- both are nucleic acids ( made up of nucleotides )
2- each nucleotide is formed of sugar ring, phosphate group and nitrogenous base.
3- both of them contain the nitrogenous bases adenine, cytosine and guanine.
differences:
1-DNA is longer
2-DNA is the storage form of all genes while RNA has 3 types. messenger RNA which is a message of certain codes, ribosomal RNA which enters in the structure of ribosomes (synthesize proteins) and transfer RNA which carries amino acids and helps in transcription process.
3-DNA contains thymine base while RNA contains uracil