Aims The role of N,N-dimethylformamide (DMF) in diabetes-induced osteoporosis (DM-OS) progression remains unclear. Here, we aimed to explore the effect of DMF on DM-OS development. Methods Diabetic models of mice, RAW 264.7 cells, and bone marrow macrophages (BMMs) were established by streptozotocin stimulation, high glucose treatment, and receptor activator of nuclear factor-κB ligand (RANKL) treatment, respectively. The effects of DMF on DM-OS development in these models were examined by micro-CT analysis, haematoxylin and eosin (H&E) staining, osteoclast differentiation of RAW 264.7 cells and BMMs, H&E and tartrate-resistant acid phosphatase (TRAP) staining, enzyme-linked immunosorbent assay (ELISA) of TRAP5b and c-terminal telopeptides of type 1 (CTX1) analyses, reactive oxygen species (ROS) analysis, quantitative reverse transcription polymerase chain reaction (qRT-PCR), Cell Counting Kit-8 (CCK-8) assay, and Western blot. Results The established diabetic mice were more sensitive to ovariectomy (OVX)-induced osteoporosis, and DMF treatment inhibited the sensitivity. OVX-treated diabetic mice exhibited higher TRAP5b and c-terminal telopeptides of type 1 (CTX1) levels, and DMF treatment inhibited the enhancement. DMF reduced RAW 264.7 cell viability. Glucose treatment enhanced the levels of TRAP5b, cathepsin K, Atp6v0d2, and H+-ATPase, ROS, while DMF reversed this phenotype. The glucose-increased protein levels were inhibited by DMF in cells treated with RANKL. The expression levels of antioxidant enzymes Gclc, Gclm, Ho-1, and Nqo1 were upregulated by DMF. DMF attenuated high glucose-caused osteoclast differentiation by targeting mitogen-activated protein kinase (MAPK) and nuclear factor kappa B (NF-κB) signalling in BMMs. Conclusion DMF inhibits high glucose-induced osteoporosis by targeting MAPK and NF-κB signalling. Cite this article: Bone Joint Res 2022;11(4):200–209.