A method is developed to fabricate monodispersed biocompatible Yb/Er or Yb/Tm doped β-NaGdF4 upconversion phosphors using polyelectrolytes to prevent irreversible particle aggregation during conversion of the precursor, Gd2O(CO3)2•H2O:Yb/Er or Yb/Tm, to β-NaGdF4:Yb/Er or Yb/Tm. The polyelectrolyte on the outer surface of nanophosphors also provided an amine tag for PEGylation. This method is also employed to fabricate PEGylated magnetic upconversion phosphors with Fe3O4 as the core and β-NaGdF4 as a shell. These magnetic upconversion nanophosphors have relatively high saturation magnetization (7.0 emu g−1) and magnetic susceptibility (1.7 × 10−2 emu g−1 Oe−1), providing them with large magnetophoretic mobilities. The magnetic properties for separation and controlled release in flow, their optical properties for cell labeling, deep tissue imaging, and their T1- and T2-weighted magnetic resonance imaging (MRI) relaxivities are studied. The magnetic upconversion phosphors display both strong magnetophoresis, dual MRI imaging (r1 = 2.9 mM−1 s−1, r2 = 204 mM−1 s−1), and bright luminescence under 1 cm chicken breast tissue.