A pentose sugar is a ring-shaped sugar with five carbon atoms (from the Ancient Greek pente). They are one of the three components of nucleic acids (together with the phosphate group and a nucleic base).

The carbon atoms are numbered from 1 to 5. When the sugar is part of a nucleic acid the numbers are 1' (read "one prime") to 5'.

There are two important pentose sugars in genetics. The nucleic acids are named for the sugars:

Deoxyribose is the sugar in deoxyribonucleic acid (DNA).

Ribose is the sugar in ribonucleic acid (RNA).

Ribose and deoxyribose differ only in the functional group on the second (2') carbon atom. Ribose has an $$\ce{-OH}$$ group and deoxyribose has a simple hydrogen attached to the carbon.

One reason is that deoxyribose sugar is more stable than ribose sugar as it has one less oxygen atom. This makes it less reactive.

Another reason relates to the use of thymine rather than uracil in DNA. Cytosine sometimes converts to uracil through a chemical reaction. Having thymine in DNA instead of uracil allows the right base to be converted back.

Uracil is also less specific in its bonding than thymine and can cause more errors in replication.

Some viruses store genetic information in RNA. As a result, they have very high mutation rates (rates at which the code changes because of errors in replication).