Hydrogen gas is given off when acids react with metals. The other product is a salt, an ionic compound. Hydrogen and table salt, or sodium chloride, is produced when hydrochloric acid reacts with pure sodium.
Two hydrogen ions combine to form H2, or hydrogen gas, which is usually seen as bubbles in solution. Some metals, such as potassium and sodium, react readily with the weakest acids and pure water, while others only react with strong acids. Certain metals, such as gold, do not react at all unless exposed to a blend of acids.
The most convenient way in the laboratory to produce hydrogen gas is through a reaction between a metal and an acid. Other ways to produce hydrogen gas are with the hydrolysis of water and by combining reactive metals with water.