Carbohydrates are fundamental molecules of life that are involved in virtually all biological processes. The chemical diversity of glycanscarbohydrate chainsenables diverse functions but also challenges analytics. Annotation of glycans in mass spectrometry (MS) data relies heavily on experimental databases or manual calculations, hindering the discovery of novel glycan compositions and structures. Here, we introduce GlycoAnnotateRa package in the open-source programming language Rfor de novo annotation of glycan compositions in MS data. GlycoAnnotateR calculates all possible monomer and modification combinations, which are then filtered against a defined set of chemical rules to provide biologically relevant compositions. The “glycoPredict” function can return compositions for oligosaccharides ranging from 1 to 22 monomers in length while accounting for four different modifications in under 10 min with less than 4 GB of random-access memory (RAM). Here, three case studies demonstrate the efficacy and versatility of GlycoAnnotateR: (1) accurate identification of mono- and oligosaccharide standards, (2) characterization of sulfated fucan oligosaccharides obtained by enzymatic digestion of fucoidan, a complex algal glycan, and (3) reproduction and expansion of glycan annotations for a published mouse lung MALDI-MS imaging data set previously annotated by NGlycDB. GlycoAnnotateR rapidly provides accurate annotations and complements existing R packages for MS data processing, enabling metabolomic and glycomic data integration. This combinatorial, rule-based approach enhances glycan annotation capabilities and supports hypothesis generation in glycoscience, expanding our ability to explore the chemical space of glycan diversity.