Reactions of acids with carbonates or hydrogencarbonates

Acids and bases react with one another by neutralisation to give substances that are less acidic and less basic.

Basic compounds having a metal cation combined with either oxide or hydroxide anion react with acids to give water and a compound containing the metal cation and the anion derived from the acid.

Compounds containing a metal ion and carbonate anion or its close relative hydrogencarbonate are also basic and react with acids.
 
CO32– (carbonate ion) accepts 2H+ to give H2CO3.

MgCO3 is an example of a carbonate.

HCO3(hydrogencarbonate ion) accepts H+ to give H2CO3

KHCO3 is an example of a hydrogen carbonate.

H2CO3 is an unstable acid that decomposes at room temperature to give H2O and CO2 (carbon dioxide) gas.  Carbon dioxide has limited water solubility.  Thus, when either carbonates or hydrogencarbonates are reacted with acids in aqueous solution, bubbling is observed due to formation of the gaseous product.

The equation for the reaction of a carbonate or hydrogencarbonate with an acid has three products.

One of these is water (H2O) as described above.

A second product is carbon dioxide (CO2) as described above.

The third product is a compound containing the metal ion and the anion from the acid 

This anion is sulfate from sulfuric acid (H2SO4), chloride from hydrochloric acid (HCl) and nitrate from nitric acid (HNO3).

Three examples of word equations of this type are shown below:
 
magnesium carbonate + hydrochloric acid → magnesium chloride + water + carbon dioxide

sodium carbonate + nitric acid → sodium nitrate + water + carbon dioxide

potassium hydrogencarbonate + sulfuric acid → potassium sulfate + water + carbon dioxide