The hexagonal-phase NaYF4:Yb3+, Er3+ hollow nanospheres (HNS) have been successfully prepared for the first time by means of a hydrothermal route with the aid of polyethylenimine (PEI) as a surfactant. The nitrogen adsorption/desorption isotherms demonstrated the porous nature of the NaYF4 HNS. The formation mechanism was explored based on the effects of the reaction parameters. The NaYF4 solid spheres underwent a dissolution-recrystallisation transformation and a hollowing process when the hydrothermal reaction time was prolonged. The localised Ostwald ripening mechanism was proposed to account for the formation of NaYF4 HNS, in which loose aggregations were found to be crucial. The upconversion luminescence of NaYF4:Yb3+, Er3+ HNS was also investigated. It is expected that these NaYF4 HNS might have potential in applications as building blocks for biolabels and drug-delivery.