A dual (colorimetric and fluorometric) method is described for sensitive and selective determination of the herbicide glyphosate. It is based on the use of a system composed of polyethylenimine-capped NaGdF4:Yb,Er upconversion nanoparticles (UCNPs), copper(II) ions, hydrogen peroxide and 3,3′,5,5′-tetramethylbenzidine. The physicochemical and photophysical properties of the polyethylenimine-capped UCNPs were characterized by various spectroscopic and microscopic techniques. The fluorescence of the UCNPs (with main emission peaks at 548 and 660 nm under 980 nm excitation) is reduced in the presence of Cu(II) because of the formation of a blue oxidation product of 3,3′,5,5′-tetramethylbenzidine as a result of the peroxidase mimicking activity of Cu(II). In the presence of glyphosate, its strong affinity for Cu(II) leads to the formation of N-(phosphonomethyl)glycine copper(II) complexes. This inhibits the quenching ability and catalysis activity of Cu(II). Hence, fluorescence is increasingly less reduced. Fluorescence at 660 nm increases linearly in the 0.05 to 125 μg·mL−1 glyphosate concentration range and the detection limit is found 9.8 ng·mL−1. The colorimetric assay (performed at 652 nm) has a detection ranges from 5 to 125 μg·mL−1, and the limit of detection is 1 μg·mL−1. Graphical abstractSchematic representation of UCNP-H2O2-TMB-Cu(II) mixed system for optical determinations of glyphosate.