This study was to purify an alpha-glucosidase inhibitor from okara (soy pulp) fermented by Bacillus subtilis B2 and to identify its chemical structure. Membrane dialysis, active charcoal, CM-Sepharose chromatography, and preparative thin-layer chromatography (TLC) were used in the purification, while positive mass spectrometry (MS) and nuclear magnetic resonance (NMR) spectrometry were used in the identification. The MS and NMR data showed that the purified alpha-glucosidase inhibitor was 1-deoxynojirimycin (DNJ) with a molecular weight of 163 Da. This is the first time that DNJ was isolated from foods fermented with Bacillus species. Okara fermentation with B. subtilis B2 might be used to produce a food-derived DNJ product as a functional food for diabetic patients.