A thermal emitter fabricated on complementary metal-oxide-semiconductor (CMOS)-compatible facilities is a key component for low-cost mid-infrared gas sensing. While conventional thermal emitters have broad spectrum and wide emission angle, which limit the sensing performance. In this work, a microelectromechanical system (MEMS)-based thermal emitter with photonic crystal has been designed and fabricated using CMOS-compatible technology. The photonic crystal enables the emission wavelength selectivity within mid-infrared regime. By engineering photonic crystal dimension, the emission enhancement wavelength can be matched to the fingerprint wavelength of chemical gas for efficient chemical gas sensing purpose.