Formal charge = valence electrons − nonbonding electrons − 1/2(bonding electrons)
Count the atom’s valence electrons from the periodic table
Count all lone-pair electrons on the atom
Count all bonding electrons around the atom
Subtract nonbonding electrons and half of bonding electrons from valence electrons
Use the result as the atom’s formal charge
Check that the sum of all formal charges equals the overall charge of the species
