Subscript
A subscript is the small number written below and after an element symbol in a chemical formula that tells how many atoms of that element are present.
Definition
A subscript is the small number written low and to the right of an element symbol, and it tells how many atoms of that element are in the formula. It applies to the element immediately before it within one molecule or formula unit, and a subscript after a closing parenthesis multiplies every atom inside the parentheses. Because changing a subscript changes the identity of the substance, subscripts are never altered when balancing equations. Subscripts encode stoichiometric ratios fixed by the compound's composition under the law of definite proportions: in molecular formulas they give absolute atom counts per molecule, in empirical formulas and ionic formula units they give the simplest ratio, and in nuclide notation ($^{A}_{Z}X$) the subscript is the atomic number.
Example
In $H_2O$, the $2$ is a subscript meaning two hydrogen atoms, and since there is no subscript on the $O$ there is one oxygen atom. In $Mg(NO_3)_2$, the inner subscript $3$ gives three oxygen atoms per nitrate and the outer subscript $2$ doubles the whole group, for $1$ magnesium, $2$ nitrogen, and $6$ oxygen atoms. Converting the subscripts of $C_6H_{12}O_6$ to a mole ratio gives $6:12:6$, or $1:2:1$ empirically, and multiplying each subscript by the molar mass of its element gives the molar mass of glucose: $6(12.01) + 12(1.008) + 6(16.00) = 180.16\text{ g/mol}$.
Key Insight
The subscript belongs only to the symbol right before it, so in $CO_2$ the $2$ counts oxygen atoms, not carbon atoms. Subscripts and coefficients answer different questions: the subscript in $H_2O$ says how the molecule is built, while a coefficient like the $2$ in $2H_2O$ says how many molecules you have. Nonstoichiometric compounds such as wüstite, roughly $Fe_{0.95}O$, carry fractional subscripts because of lattice defects, so the neat whole-number subscripts of introductory chemistry describe ideal crystals and real solids sometimes disobey them.