Ionic bonding is the electrostatic attraction between oppositely charged ions. Electron transfer is a way ions can form; the bond itself is the attraction throughout a lattice. The empirical formula records the simplest whole-number ion ratio.
In sodium chloride sodium loses an electron to form Na⁺ and chlorine gains an electron to form Cl⁻. Both have stable outer shells. Equal positive and negative charges require a 1:1 ratio, giving NaCl. Magnesium chloride needs two chloride ions for every Mg²⁺.
Solid ionic compounds usually do not conduct electricity because ions are fixed in a lattice. Molten ionic compounds conduct through mobile ions. Many aqueous ionic solutions also conduct; the presence of charged particles is insufficient unless those particles can move.
A covalent bond consists of a shared electron pair between atoms. In a simple dot-and-cross diagram each atom contributes electrons and each shared pair counts toward the outer shell of both bonded atoms. Hydrogen seeks a duet rather than an octet.
Water has two O–H bonds and two lone pairs on oxygen. Methane has four C–H single bonds and no lone pair on carbon. Multiple bonds share two or three pairs; O₂ has a double bond in the elementary representation and N₂ a triple bond.
Simple molecular substances often have low melting and boiling points because intermolecular attractions are weaker than the bonds within molecules. This statement does not apply to giant covalent structures such as diamond. Most simple molecular substances lack mobile charged particles and do not conduct in the pure state.
A coordinate covalent bond forms when both electrons of a shared pair are supplied initially by one donor atom. The acceptor must have a suitable vacant orbital. Once formed, it is a shared-pair bond; its origin does not make it an ionic attraction.
Ammonia has a lone pair on nitrogen. H⁺ can accept that pair, forming NH₄⁺. The whole ion carries charge +1. In dot-and-cross formation diagrams distinguish the donor pair, then place the ion in brackets with its charge.
Water can donate an oxygen lone pair to H⁺ to form H₃O⁺. Electron donation in forming a coordinate bond must not be confused with the complete electron transfer used to describe simple ion formation. Charge and total electron count provide useful checks.