For purposes of describing chemical behavior, an atom can be considered as a positively charged nucleus surrounded by negatively charged electrons orbiting in concentric spherical shells. The number of positive charges in the nucleus determines how many electrons normally surround the nucleus; as atomic number increases, the electron shells are filled, starting with those nearest the nucleus.
The valence of an atom is determined by the number of electrons in the outermost, or valence, shell. The atom exists in its most stable configuration when its outermost shell is completely filled; in combining with other atoms, it thus tends to gain or lose valence electrons in order to attain a stable configuration. If the valence shell of the atom is nearly complete, as in chlorine and other nonmetals, the atom will tend to accept electrons to complete it; if the valence shell has few electrons, as in potassium and other metals, the atom will tend to lose these electrons, so that the next shell below the valence shell becomes a completed outermost shell.
The valence of many elements is determined from their ability to combine with hydrogen or to replace it in compounds. For example, one oxygen atom combines with two hydrogen atoms to form water and the valence of oxygen is thus determined to be 2. Similarly, chlorine accepts one electron in combining with a single atom of hydrogen to form hydrogen chloride, HCl, and chlorine's valence is 1. Zinc does not combine with hydrogen but does replace it in compounds; in a typical replacement reaction, one zinc atom replaces two hydrogen atoms, as in the equation Zn+H2SO4→ZnSO4+H2, so that zinc has a valence of 2.