The simple and accurate monitoring of blood glucose level is of great significance for the prevention and control of diabetes. In this work, a magnetic nanozyme was fabricated based on loading nitrogen-doped carbon dots (N-CDs) on mesoporous Fe3O4nanoparticles for the colorimetric detection of glucose in human serum. Mesoporous Fe3O4nanoparticles were easily synthesized using a solvothermal method, and N-CDs were then prepared in situ and loaded on the Fe3O4nanoparticles, leading to a magnetic N-CDs/Fe3O4nanocomposite. The N-CDs/Fe3O4nanocomposite exhibited good peroxidase-like activity and could catalyze the oxidation of the colorless enzyme substrate 3,3′,5,5′-tetramethylbenzidine (TMB) to blue TMB oxide (ox-TMB) in the presence of hydrogen peroxide (H2O2). When the N-CDs/Fe3O4nanozyme was combined with glucose oxidase (Gox), Gox catalyzed the oxidization of glucose, producing H2O2and leading to the oxidation of TMB under the catalysis of the N-CDs/Fe3O4nanozyme. Based on this mechanism, a colorimetric sensor was constructed for the sensitive detection of glucose. The linear range for glucose detection was from 1 to 180 μM, and the limit of detection (LOD) was 0.56 μM. The recovered nanozyme through magnetic separation showed good reusability. The visual detection of glucose was also realized by preparing an integrated agarose hydrogel containing the N-CDs/Fe3O4nanozyme, glucose oxidase, and TMB. The colorimetric detection platform has an enormous potential for the convenient detection of metabolites.