We present a straightforward and generic strategy for coating upconverting nanoparticles (UCPs) with polymer shells for their protection, functionalization, conjugation, and for biocompatibility. UCPs are attracting much attention for their potential use as fluorescent labels in biological applications. However, they are hydrophobic and non-compatible with aqueous media; thus prior surface modification is essential. Our method uses the internal UV or visible light emitted from UCPs upon photoexcitation with near-infrared radiation, to locally photopolymerize a thin polymer shell around the UCPs. In this way, a large variety of monomers with different chemical functionalities can be incorporated. If required, a second layer can be added on top of the first. Our method can provide a large spectrum of surface functional groups rapidly and in one pot, hence offering a platform for the preparation of libraries of functional polymer-encapsulated UCPs for applications in bioassays, biosensing, optical imaging, and theranostics.