A new densification model, which simulates the effect of impurities on the densification of polar firn, is presented. The classical densification models of Herron and Langway (1980) and Pimienta and Barnola (Barnola and others, 1991) are modified by assuming that the activation energy for deformation is reduced by the impurities. Motivated by recent observations, the impurity effect is formulated on an empirical basis using the seasonally varying Ca2+ ion concentration. Excellent agreement between simulated and measured high-resolution density profiles confirms the new approach. The same parameterization applies for Greenland and Antarctica despite the one order of magnitude difference in impurity concentration. The new models allow us, for the first time, to simulate the density layering in firn down to the firn–ice transition. Our results emphasize the importance of impurities and density layering for the air entrapment and for dating gas records of deep ice cores, in particular for glacial climate conditions where the impurity concentrations are 10–100-fold higher than in modern firn.