The best therapy for diabetic foot osteomyelitis (DFO) is controversial. However, identification of the precise localization of DFO is essential for appropriate treatment. AIM To ascertain the efficacy of magnetic resonance imaging (MRI) in the diagnosis of DFO, and to select the appropriate surgical margin. METHODS Preoperative MRI findings were compared with the results of histopathological examinations of resected bones, and the margins of the resected bones were analysed by histopathology. A total 149 bones from 28 foot ulcers in 26 patients were examined. All ulcers were classified into 4 types according to the main etiological factors. RESULTS In 14 neuropathic ulcers, all 55 bones, even those with severe infection, were fully and accurately diagnosed with the use of MRI. In 14 ischemic ulcers, only 9 of 94 bones evaluated by MRI after revascularization were diagnosed accurately. Of 32 bone margins that showed bone marrow oedema, 28 healed, and 4 did not heal, displaying severe infection or ischemia. CONCLUSIONS MRI is effective in the diagnosis of neuropathic ulcers, but not as effective in the diagnosis of ischemic ulcers. This study suggested that the appropriate surgical margin should be defined in the area of the bone marrow oedema, but diligence should be exercised in cases with severe infection or ischemia.