In this paper we calculate the density profiles of virialized halos both in
the case of structure evolving hierarchically from a scale-free Gaussian d
elta-field having a power spectrum P(k) proportional to k(n) in a Omega = 1
Universe and in the case of the CDM model, by using a modified version of
Hoffman & Shaham's (1985) (hereafter HS) and Hoffman's (1988) model. We sup
pose that the initial density contrast profile around local max ima is give
n by the mean peak profile introduced by Bardeen et al. (1986) (hereafter B
BKS), and is not just proportional to the two-point correlation function, a
s assumed by HS. We show that the density profiles, both for scale-free Uni
verses and the CDM model, are not power-laws but have a logarithmic slope t
hat increases from the inner halo to its outer parts. Both scale-free, for
n greater than or equal to -1, and CDM density profiles are well approximat
ed by Navarro et al. (1995, 1996, 1997) profile. The radius a, at which the
slope alpha = -2, is a function of the mass of the halo and in the scale-f
ree models also of the spectral index n.