In this paper, we develop a simple theoretical framework to compute optimal urban-rail station spacing, first with a one- and then with a two-dimensional population density distribution. For small numbers of stations, numerical methods maximising total passenger-km give the optimal spacings, and it is found that stations should indeed be significantly more dispersed in the suburbs. The fixed nature of station infrastructure, however, means that as urban density patterns evolve, the stations will progressively become located in the wrong positions, with associated efficiency losses. Numerical methods are also used to estimate the seriousness of these efficiency losses in the simplest cases. The findings on station spacing are compared with the urban-rail systems of London, Munich, Paris and Washington, DC.