Fluorescent carbon dots (CDs) were prepared for targeted cancer imaging and in vivo imaging. The CDs were prepared via one-step hydrothermal pyrolysis of urea and sodium citrate dihydrate. The CDs revealed nice crystalline structure, excellent aqueous stability and good photoluminescence property and high quantum yield. The fluorescent images indicated that the anti-HE4-CDs were specifically internalized by the HO-8910 ovarian cancer cells. Furthermore, the CDs revealed vivid fluorescent signal in the animal imaging test and promising potential in brain imaging. Finally, the CDs also suggested low toxicity after treatment for 1 day, 7 days and 21 days. Therefore, the prepared CDs could be a promising imaging probe for targeted cancer cell imaging and in vivo imaging.