Biocrusts are an important component of dryland ecosystems as they perform crucial ecological functions like stabilizing soils, mediating the hydrological cycle, and improving nutrient availability. The high mechanical stability of biocrusts is understood to be linked to exopolymeric substances (EPS), which in turn, are responsible for the adsorption of various ions and chemical compounds. This study aimed to investigate the chemical composition of biocrusts and assess potential correlations between their chemical composition and mechanical stability. Samples of three types of biocrusts (cyanobacteria, cyanobacteria and moss mixed, and moss crusts) and bare soil (as control) were collected from the northern Loess Plateau of China. The inorganic ions and organic compounds present in biocrusts were quantified using inductively coupled plasma-optic emission spectrometry, ion chromatography, and gas chromatography-mass spectrometry. Biocrust mechanical stability was assessed by penetration resistance (PR) and the mean weight diameter (MWD) of aggregates. Finally, the contribution of inorganic ions and organic compounds to the stability of the biocrusts was elucidated. The results indicated that all three types of biocrusts were more stable than bare soil, with moss crusts being the most stable. Chemical analyses revealed an enrichment of inorganic ions such as K+, Ca2+, Na+, Mg2+, SO42–, and halogen ions within the biocrusts, while they showed a depletion of Fe2+, Al3+, and NO3–. Ten types of organic compounds were identified in biocrusts and bare soil, with medium-chain alkanes and long-chain acids being the dominant compounds. In some cases, acids accounted for more than 40 % of the total organic compound content of the biocrusts. Redundancy analysis showed that the content of inorganic ions, such as Ca2+ and Mg2+, and organic compounds such as acids, amides, and alkenes, exhibited the closest association with the biocrust stability. Partial least squares path modeling indicated that both inorganic ions and organic compounds indirectly affected biocrust stability by influencing electric conductivity, bulk density, EPS, and fine particle (clay and silt) content. A strong association was found between the inorganic ions and PR or MWD (0.658 and 0.744, respectively), whilst the total effect of organic compounds on PR and MWD was 0.814 and 0.801, respectively. It is suggested that both the magnitude and types of chemicals associated with EPS indicate their capability to grant mechanical stability of the biocrusts, which in turn is conducive to maintaining the critical functions of biocrusts in global drylands.