Hydrogen, carbon, nitrogen, and oxygen are electrical active elements in III–V compounds and the knowledge of their concentrations in these materials is of primary importance. The secondary‐ion mass spectrometry (SIMS), under cesium bombardment and negative secondary‐ion collection, is probably the most powerful technique which has been developed to address this problem because it enables quantitative analyses with good lateral and depth resolutions to be made. Recent investigations using SIMS have shown that the detection limits of gaseous species are limited by the redeposition of vacuum contaminant molecules onto the sample surfaces, or by the ionization of these molecules in the gas phase. As a consequence, these limits critically depend on the experimental conditions, i.e., they are differently dependent on the etching rate: they decrease more steeply when reducing the raster‐scanned area for a fixed primary current than when decreasing the primary current for a fixed eroded area. The previous experiments were performed in GaAs, mainly for carbon and oxygen. This paper describes similar investigations for H, C, N, and O in InP. H, C, N, and O were implanted to the same dose (1015 cm−2) at different energies so as to obtain maximum distributions at about 700 nm. The depth profiles of the respective elements were monitored and quantified for three primary beam currents (25, 50, and 100 nA) raster scanned, in turn, over three different areas (75, 50, and 25 μm2). The detection limits were deduced from the background levels without any substraction. The best values were 1–1.5×1016, 1×1016, 5–7×1014, and 5–7×1015 cm−3 for H, C, N, and O, respectively. The low limit measured for nitrogen was obtained by monitoring 31P2N− clusters. Such molecular ions are revealed to exhibit high ionization probabilities and they could be recommended to improve the sensitivity. The technique which consists in rastering moderate primary currents over small areas results in a compromise between low detection limits and sharp depth resolutions, but it will be shown that relatively low detection limits are attainable at low erosion rates by decreasing only the primary current.