The geometries and vibrational frequencies of the hydrogen and halogen peroxides XOOX' and the XOO and XO fragments (X, X'=H, F, Cl, Br or I) have been studied using non-local density functional theory. The X-O, X'-O and O-O bond energies have been calculated and likely dissociation paths for these atmospherically important or potentially important molecules suggested. The sulfur analogues have also been examined. A unified model for these chemically diverse species is presented based on the interaction between O-2 and X ... X fragments. The correlation between their electronic structures is outlined. The antibonding nature of the interaction between the halogen lone pairs and the pi electrons of the O-2 fragments causes lengthening and weakening of the halogen-oxygen bonds. The electronegativity of X and X' determines the extent and direction of the electron transfer between the O-2 and X ... X fragments. The O-O bond order is thus sensitive to the nature of the substituents and the multiple bond character decreases steadily as the electronegativity of X and X' decreases. The O-O bond strengths, though, are also affected by steric interactions between the halogen 'lone pairs'. The O-O bonds in the HO-OX' species are thus much stronger than the bond orders and lengths suggest.