Carbon-encapsulated iron-based alloy nanoparticles with a core-shell structure were prepared by detonation decomposition of nitrate complex explosives containing multi-metallic ions. The size and magnetic properties of the as-prepared composite particles were revealed by X-ray powder diffraction, transmission electron microscopy, energy dispersive X-ray detector and magnetic measurements. Results showed that the different sizes of the ferronickel and ferrocobalt nanocrystal core and the thickness of the carbon shell could be yielded by adjusting the component materials of the explosives. The composite particles had a gamma- or alpha- ferronickel or bcc-ferrocobalt nanocrystal core with a coating of graphitic carbon layers. Magnetic measurements indicated these composite nanoparticles were superparamagnetism at the room temperature, with some variation in the values of saturation magnetization, remanences and coercive forces.