In cooking, baking soda is primarily used in baking as a leavening agent. When it reacts with acid or is heated, carbon dioxide is released, which causes expansion of the batter and forms the characteristic texture and grain in cakes, quick breads, soda bread, and other baked and fried foods. When an acid is used, the acid–base reaction can be generically represented as follows:[14]