Magnetic Fe<sub>3</sub>O<sub>4</sub> nanoparticles show promising applications in nanomedicine. The saturation magnetization (<i>M</i><sub>S</sub>) and magnetic anisotropy are critical for the applications of Fe<sub>3</sub>O<sub>4</sub> nanoparticles in drug delivery and magnetic hyperthermia. Here, by density functional computation, the doping effects of 3d and 4d transition metal elements (including Sc, Ti, V, Cr, Mn, Fe, Co, Ni, Cu, Zn, Y, Zr, Nb, Mo, Tc, Ru, Rh, Pd, Ag and Cd) on the magnetic properties of Fe<sub>3</sub>O<sub>4</sub> are investigated in-depth. A conventional cell of Fe<sub>3</sub>O<sub>4</sub>, containing 24 Fe atoms and 32 O atoms, has been used to investigate the doping of group III elements. One 3d or 4d atom is doped in one conventional cell of Fe<sub>3</sub>O<sub>4</sub>, resulting in the formation of X<sub>0.125</sub>Fe<sub>2.875</sub>O<sub>4</sub> where X represents the dopant. The results show that the doping of most 3d and 4d transition metal elements will reduce the total magnetic moment, while the doping of Ag, Zn and Cd in Fe<sub>3</sub>O<sub>4</sub> will increase the total magnetic moment by 19%–22%. However, it is hard to dope Ag into Fe<sub>3</sub>O<sub>4</sub> according to the positive formation energy. Therefore, Zn and Cd are good candidates to improve the <i>M</i><sub>S</sub> of Fe<sub>3</sub>O<sub>4</sub>. The doping of Zn and Cd has also an influence on the magnetic anisotropy of Fe<sub>3</sub>O<sub>4</sub>. For Zn<sub>0.125</sub>Fe<sub>2.875</sub>O<sub>4</sub>, the magnetic anisotropy energy is about 0.25 meV per cell, which is slightly larger than that of intrinsic Fe<sub>3</sub>O<sub>4</sub> (0.2 meV per cell). Interestingly, the doping of Cd (Cd<sub>0.125</sub>Fe<sub>2.875</sub>O<sub>4</sub>) will greatly increase the magnetic anisotropy energy to 0.8 meV per cell, which is significant for the specific absorption rate in the magnetic hyperthermia application. In addition, the doping of Zn and Cd will not induce any defect states in the band gap according to the density of states. Zn<sub>0.125</sub>Fe<sub>2.875</sub>O<sub>4</sub> and Cd<sub>0.125</sub>Fe<sub>2.875</sub>O<sub>4</sub> are both semiconducting and both the top of valence band and the bottom of conduction band originate from octahedral Fe. This is because the impurity states are very deep in energy. Our research results show that doping Cd is a feasible way to improve the performance of Fe<sub>3</sub>O<sub>4</sub> as a material for drug delivery and magnetic hyperthermia.