Compounds are made by combining valence electrons of elements. The resulting compound is represented by what is known as its Lewis Structure. Each atom in the Lewis structure contributes its charge to give an overall molecular charge to the compound. The simplest way to calculate the charge on each atom is by subtracting ½ the bonded electrons plus lone pair count from the atom’s valence electrons. Valence electrons are based on the position of the atom (element) on the Periodic Table. They are B = 3, C = 4, N = 5, O = 6, F = 7 based on the p-orbital electronic count. The formula then is:
The associated electrons can be counted as:
A simple addition of each atom charge gives the overall charge of the compound.
Try the process for yourself. In general: