Why is baking soda and vinegar have carbon dioxide?

Baking soda (sodium bicarbonate) and vinegar (acetic acid) react to form carbon dioxide gas, water, and sodium acetate. The chemical equation for this reaction is:

NaHCO3 + CH3COOH → CO2 + H2O + CH3COONa

When baking soda and vinegar are mixed, the hydrogen ions (H+) from the vinegar react with the bicarbonate ions (HCO3-) from the baking soda to form carbonic acid (H2CO3). Carbonic acid is unstable and quickly decomposes into carbon dioxide gas (CO2) and water (H2O). The carbon dioxide gas bubbles up and causes the mixture to fizz.

The sodium ions (Na+) from the baking soda and the acetate ions (CH3COO-) from the vinegar remain in the solution and form sodium acetate, a salt.

Carbon dioxide gas is commonly used as a leavening agent in baking. When baking soda and vinegar are added to a batter or dough, the carbon dioxide gas that is produced causes the batter or dough to rise. This is what makes baked goods light and fluffy.