Using in situ surface X-ray diffraction we have determined the atomic structure and stability of a Pt3Ni(1 1 1) surface in the electrochemical environment. Surface segregation leads to a pure Pt(1 1 1) skin with enrichment of Ni in the sub-surface atomic layer that determines the surface electronic structure. The Pt-skin surface exhibits inward relaxation upon the adsorption of oxygenated species and this explains the surface stability compared to pure Pt(1 1 1). Using Monte Carlo calculations it is shown that nanoparticles with the same surface composition and stochiometry are energetically stable.