Carbohydrate libraries printed in glycan micorarray format have had a great impact on the high-throughput analysis of the specificity of a wide range of mammalian, plant, and bacterial lectins. Chemical and chemo-enzymatic synthesis allows the construction of diverse glycan libraries but requires substantial effort and resources. To leverage the synthetic effort, the ideal library would be a minimal subset of all structures that provides optimal diversity. Therefore, a measure of library diversity is needed. To this end, we developed a linear representation of glycans using standard chemoinformatic tools. This representation was applied to measure pairwise similarity and consequently diversity of glycan libraries in a single value. The diversities of four existing sialoside glycan arrays were compared. More diverse arrays are proposed reducing the number of glycans. This algorithm can be applied to diverse aspects of library design from target structure selection to the choice of building blocks for their synthesis.