Calcium carbonate reacts with hydrochloric acid to form calcium chloride, water and carbon dioxide. The reaction between these two compounds requires two parts hydrochloric acid to one part calcium chloride. This reaction is fairly rapid and energetic at high concentrations, in large part due to the high affinity of calcium ions for chloride ions.
Both of these compounds are ionic, with a hydrogen ion bound to a chloride ion in hydrochloric acid and a calcium ion bound to a carbonate group in calcium carbonate. The carbonate group is actually covalently bonded carbon and oxygen, but the calcium carbonate as a whole is ionic. Two chloride ions bond to one calcium ion. The high affinity of the hydrogen ions to oxygen splits apart the carbonate group, covalently bonding with one oxygen ion to form a water molecule. The carbonate group, stripped of one oxygen ion, becomes a neutral carbon dioxide molecule.
Stomach acid is hydrochloric acid, so calcium carbonate is commonly used as an antacid because the products of this reaction are harmless to humans. The body uses a somewhat similar compound, bicarbonate, to neutralize stomach acid on its own. Hydrochloric acid is also a component of acid rain. This can cause heavy erosion in limestone, which is largely composed of calcium carbonate.