In this study, we have analyzed the ion mass‐to‐charge composition of the plasma of a magnetron discharge with a titanium target operating in various gases: argon, nitrogen, oxygen, and their mixtures. The addition of nitrogen and oxygen to argon significantly affects the ion spectrum in the magnetron discharge plasma. The increased fraction of nitrogen in the mixture of more than 15% contributes to the dominance of atomic nitrogen ions in the spectrum and leads to a strong decrease in both the plasma density and the metal (titanium) ion fraction in the plasma. The addition of more than 10% oxygen leads to the complete absence of metal ions in the spectrum. These effects are associated with the formation of nitride and oxide layers on the titanium target surface, thus inhibiting the introduction of metal ions in the plasma.