If a molecule contains two asymmetric centers, there are up to four possible configurations, and they cannot all be non-superposable mirror images of each other. The possibilities for different isomers continue to multiply as more stereocenters are added to a molecule. In general, the number of stereoisomers of a molecule can be determined by calculating 2, where n = the number of chiral centers in the molecule. This holds true except in cases where the molecule has meso forms. These meso compounds are molecules that contain stereocenters, but possess an internal plane of symmetry allowing it to be superposed on its mirror image. These equivalent configurations cannot be considered diastereomers.
For n = 3, there are eight stereoisomers. Among them, there are four pairs of enantiomers: R,R,R and S,S,S; R,R,S and S,S,R; R,S,S and S,R,R; and R,S,R and S,R,S. There are many more pairs of diastereomers, because each of these configurations is a diastereomer with respect to every other configuration excluding its own enantiomer (for example, R,R,R is a diastereomer of R,R,S; R,S,R; and R,S,S). For n = 4, there are sixteen stereoisomers, or eight pairs of enantiomers. The four enantiomeric pairs of aldopentoses and the eight enantiomeric pairs of aldohexoses (subsets of the five- and six-carbon sugars) are examples of sets of compounds that differ in this way.