To express the calculations in a general way, the formal charge on an atom is equal to the number of valence electrons in a neutral, isolated atom minus the number of electrons owned by that bonded atom in a molecule. The number of electrons in the bonded atom, in turn, is equal to half the number of bonding electrons plus the nonbonding, lone-pair electrons.