A first-principles model of the electrochemical double layer is applied to study surface energies and surface coverage under realistic electrochemical conditions and to determine the equilibrium shape of metal nanoparticles as a function of applied potential. The potential bias is directly controlled by adding electronic charge to the system, while total energy calculations and thermodynamic relations are used to predict electrodeposition curves and changes in surface energies and coverage. This approach is applied to Pt surfaces subject to hydrogen underpotential deposition. The shape of Pt nanoparticles under a cathodic scan is shown to undergo an octahedric-to-cubic transition, which is more pronounced in alkaline media due to the interaction energy of the pH-dependent surface charge with the surface dipole. DOI: 10.1103/PhysRevLett.110.086104