Cyanide compounds of the alkali metals and alkaline earths are commonly found to possess "branched" or π-complex structures in which the metal atom is almost equidistant from both atoms of the CN moiety. Here we present an investigation of the potential energy surfaces for various compounds of the form XMg(CN), using the Gaussian-2 (G2) procedure. Our results suggest that magnesium, at least, is not so prone to π-complex formation with the cyanide ligand as has previously been implied, since the presence of the π complex upon the potential energy surface is strongly dependent upon the level of theory employed in geometry optimizations. We find also that, according to G2 theory, the preference of magnesium for isocyanide (rather than cyanide) formation is small but consistent, with XMgNC isomers having calculated heats of formation between 2 and 5 kJ mol −1 below their XMgCN counterparts. The barriers to interconversion of cyanide and isocyanide isomers are also calculated to be comparatively small, typically ∼25 kJ mol −1 . In contrast, calculations for protonated species FMg(CN)H + and Mg(CN) 2 H + have determined that the π complexes in these species are indeed stable against CN-ligand reorientation.