Unbiased estimation of population density is a major and unsolved problem in animal trapping studies. This paper describes a new and general method for estimating density from closed-population capture–recapture data. Many estimators exist for the size (N) and mean capture probability ( p̄) of a closed population. These statistics suffer from an unknown bias due to edge effect that varies with trap layout and home range size. The mean distance between successive captures of an individual () provides information on the scale of individual movements, but is itself a function of trap spacing and grid size. Our aim is to define and estimate parameters that do not depend on the trap layout. In the new method, simulation and inverse prediction are used to estimate jointly the population density (D) and two parameters of individual capture probability, magnitude (g0) and spatial scale (σ), from the information in , p̄ and . The method uses any configuration of traps (e.g. grid, web or line) and any choice of closed-population estimator. It is assumed that home ranges have a stationary distribution in two dimensions, and that capture events may be simulated as the outcome of competing Poisson processes in time. The method is applied to simulated and field data. The estimator appears unusually robust and free from bias.