Chemoresistance has become a major obstacle to the success of cancer therapy, but the mechanisms underlying chemoresistance are not yet fully understood. O-GlcNAcylation is a post-translational modification that is regulated by the hexosamine biosynthetic pathway (HBP) and has an important role in a wide range of cellular functions. Here we assessed the role of O-GlcNAcylation in chemoresistance and investigated the underlying cellular mechanisms. The results showed that the HBP has an important role in cancer cell chemoresistance by regulating O-GlcNAcylation. An increase in the levels of O-GlcNAcylation indicates an increased resistance of cancer cells to chemotherapy. Acute treatment with doxorubicin (DOX) or camptothecin (CPT) induced O-GlcNAcylation through HBP activation. In fact, the chemotherapy agents activated the AKT/X-box-binding protein 1 (XBP1) axis and then induced the HBP. Furthermore, the observed elevation of cellular O-GlcNAcylation led to activation of survival signalling pathways and chemoresistance in cancer cells. Finally, suppression of O-GlcNAcylation reduced the resistance of both established and primary cancer cells to chemotherapy. These results provide significant novel insights regarding the important role of the HBP and O-GlcNAcylation in regulating cancer chemoresistance. Thus, O-GlcNAc inhibition might offer a new strategy for improving the efficacy of chemotherapy.