Nanoporous carbon particles with different particle sizes are synthesized by simple carbonization of monodispersed zeolitic imidazolate framework-8 (ZIF-8) crystals. Quartz crystal microbalance (QCM) study proves that the use of small-sized nanoporous carbon can lead to both a large adsorption uptake and a faster sensor response for toxic toluene molecules.