An analytic collapse model for the formation and density distribution of virialized cold dark matter halos is proposed. Hierarchical structure formation is taken into account explicitly. Monte Carlo methods are used to generate samples of mass histories of virialized halos. The mean density distribution found from the collapse model is in good agreement with numerical results in the mass range from 10(11) to 10(15) M. and in the radial range from 0.05r(200) to r(200).