Bond counts
SeriesGeneral formulaTotal covalent bondsCheck with n = 2
AlkaneCnH2n+23n + 1Ethane C2H6: 7 bonds
Alkene (one C=C)CnH2n3nEthene C2H4: 6 bonds
Alkyne (one C≡C)CnH2n−23n − 1Ethyne C2H2: 5 bonds

Total covalent bonds in a hydrocarbon = (4 × C + H) ÷ 2: alkanes 3n + 1, alkenes 3n, alkynes 3n − 1. Electrons shared = 2 × bonds.

— Rule to remember

Carbon shares electrons because gaining or losing four is unfavourable. Tetravalency and catenation explain the huge number of carbon compounds. Use (4C + H) ÷ 2 for bond counts and double it for shared electrons. Diamond has four bonds per carbon in three dimensions; graphite has three per carbon in layers and conducts.