After characterizing Ni-Mg-Co magnetic ferrite nanoparticles doped with Al3+, La3+, Ce3+, Pr3+ and Sm3+ , the structure, magnetic properties, and other aspects of both the doped and pure samples show, through comparative analysis, the characteristic peaks and absorption bands belonging to the spinel structure, which proves that the prepared samples have a single-phase spinel structure. According to the Debye–Scherrer formula, the calculated average crystallite size decreased from 56.7 to 36.6 nm after doping with rare-earth ions, while doping with Al3+ caused the average crystallite size to increase to 90.7 nm. Doping nickel-magnesium-cobalt ferrite with Al3+ and rare-earth ions has a certain effect on its magnetic properties. The remanent magnetization (Mr), square degree (Mr/Ms), coercivity rectangle degree (S*) and anisotropy constant (K) all increase after doping with rare-earth ions, but they decrease after doping with Al3+.