The effect of impurities on the hydrogen storage capacity of magnesium was studied. The metal used was a mechanically produced magnesium powder with a mean particle diameter of 30 mum. The foreign gases considered were oxygen, nitrogen, carbon dioxide and carbon monoxide, in concentrations of 0.5% in pure hydrogen, except for that of carbon dioxide which was 2%. The effects described were observed by absorbing and desorbing once in a microbalance and by performing the storage cycle in the order of 100 times using pure hydrogen and then switching to impure hydrogen, observing the change in absorption behaviour. The effects of the four gases were different. Oxygen reacted heavily with the metal, but still allowed the formation of hydride at a reduced rate. Nitrogen caused a slow-down in absorption speed, but left the metal powder almost unchanged after desorption. Carbon monoxide practically prevented hydrogen uptake. Finally, carbon dioxide in a concentration of 2% totally prevented hydrogen uptake. The results are discussed and explanations for the observations are given.