Mathematically, the atomic percent is
where N are the number of atoms of interest and N are the total number of atoms, while the atomic ratio is
For example, the atomic percent of hydrogen in water (HO) is , while the atomic ratio of hydrogen to oxygen is .