We demonstrate the detection of metallic and nonmetallic foreign bodies in chocolate using pulsed terahertz imaging. Investigating the shape of the temporal waveform allows for the discrimination between wanted ingredients like nuts on one hand and foreign bodies like stone, glass, or plastic particles on the other hand. Yet, the intensity image alone does not provide enough information to evaluate the quality of the chocolate bar. To achieve a low false-alarm rate it is important to measure the height profile of the sample and to include the measured results in the image-processing step. Our results show that terahertz imaging can be used for the detection of contaminations in chocolate bars. Furthermore, other kinds of dry food can be investigated with our technique.