Magnetic nonviral gene vectors were in situ prepared in the presence of ferrous salts andhyperbranched poly(ethylenimine)s (HPEI) with different molecular weights. HPEI, one of themost promising nonviral vectors, was not only utilized as the nanoreactor and stabilizer toprepare magnetic nanoparticles, but also skillfully used as a base supplier to avoid introducingalkali hydroxide or ammonia. Magnetic nonviral gene vectors with various magnetite contentsand saturation magnetizations were obtained by changing the weight ratio of HPEI toFeSO4·7H2O and the molecular weight of HPEI. MTT assays suggested that the resultingmagnetite/HPEI gene vectors had lower cytotoxicity compared with pure HPEI. Themagnetite/HPEI nonviral gene vectors were used for magnetofection. It was found that theluciferase expression level mediated by magnetite/HPEI in COS-7 cells under a magneticgradient field was approximately 13-fold greater than that of standard HPEI transfection.