In situ monitoring of hydrogen peroxide (H2O2) during its production process is needed. Here, an electrochemical H2O2 sensor with a wide linear current response range (concentration: 5 x 10(-8) to 5 x 10(-2) m), a low detection limit (32.4 x 10(-9) m), and a high sensitivity (568.47 mu A mm(-1) cm(-2)) is developed. The electrocatalyst of the sensor consists of cobalt nanoparticles and atomic Co-N-x moieties anchored on nitrogen doped carbon nanotube arrays (Co-N/CNT), which is obtained through the pyrolysis of the sandwich-like [email protected] complex. More cobalt nanoparticles and atomic Co-N-x as active sites are exposed during pyrolysis, contributing to higher electrocatalytic activity. Moreover, a portable screen-printed electrode sensor is constructed and demonstrated for rapidly detecting (cost approximate to 40 s) H2O2 produced in microbial fuel cells with only 50 mu L solution. Both the synthesis strategy and sensor design can be applied to other energy and environmental fields.