Matter and chemical change
A chemical change rearranges atoms into new substances, and no atoms are gained or lost, so the total mass stays the same.
A worked example
A sealed flask holding 5.0 g of one reactant and 3.0 g of another, both fully used up, must contain 8.0 g of product afterwards.
The mistake people actually make
Mass only appears to change when a gas escapes or air is drawn in. Steel wool burned in an open dish gains mass, because oxygen joins it. Melting and dissolving are physical changes; burning and rusting are chemical.