Food products that are extensively distributed in the community, notably in traditional markets, and often consumed by the public, such as tofu, are frequently discovered to contain formaldehyde, according to BPOM laboratory tests in 2020. In reality, the usage of these materials is quite hazardous. As a result, a more accurate and cost-effective detector for detecting formaldehyde is required. Therefore, the authors of this study intended to create a formaldehyde detector based on a gas sensor. The purpose of this research was to design a formaldehyde detector utilizing a gas sensor and to identify a gas sensor that can detect formaldehyde. The gas sensors that were utilized in this research were MQ-2, MQ-4, MQ-5, MQ-6, and MQ-9 gas sensors. The test was carried out on a specific sort of pure formaldehyde solution with a determined concentration. There were five replications of each treatment: 0 ppm, 100 ppm, and 200 ppm formaldehyde solutions. Based on the results of the study, the gas sensor with an adequate response to detect formaldehyde is MQ-2 at concentrations of 0 ppm, 100 ppm, and 200 ppm. Conversely, MQ-4, MQ-5, MQ-6, and MQ-9 gas sensors were less accurate to formaldehyde compounds.