Formal charge is an electron-bookkeeping device that gives the charge on a bonded atom in a Lewis structure relative to a nonbonded atom of the same element.
To calculate formal charge
compare the number of electrons "owned" by a bonded atom to the number owned by the corresponding nonbonded atom. Assume in your count that
- nonbonding electrons at the atom are "owned" by that atom
- bonding electrons are equally shared. Each bonded atom owns one electron of each bond.
At Xe in XeF4 4 bonding 4 nonbonding = 8 Nonbonded Xe (Group 18) has 8 valence electrons | At P in PCl3 3 bonding 2 nonbonding = 5 Nonbonded P (Group 15) has 5 valence electrons | At B in BF3 3 bonding 0 nonbonding = 3 Nonbonded B (Group 13) has 3 valence electrons |
Thus the formal charge at each of these central atoms is zero. Similarly the charge on F and Cl (Group 17) in the structures is zero as each of these owns seven (six nonbonding and one) electrons. This is equal to the number of valence electrons on a nonbonded halogen atom.