Mycotoxin contamination poses a great threat to food safety and human health. Thus, universal and sensitive detection of mycotoxins is urgently needed. Herein, N/O co-doped porous biomass carbon was synthesized from rice straw as a novel electrode modification material for fabricating an electrochemical sensor for mycotoxin detection. The fabricated sensor exhibited excellent universality in the detection of aflatoxin B1, aflatoxin G1, aflatoxin G2, aflatoxin M1, zearalenone, and deoxynivalenol. The limits of detection were ca. 0.5689, 0.0504, 0.0274, 0.6141, 0.0781, and 0.0512 fg·mL