The invention discloses NOBF4 modified up-conversion nanoparticles, a Dye-NOBF4-UCNPs nanometer probe, preparation methods of the nanoparticles and the Dye-NOBF4-UCNPs nanometer probe, and a sulfur-containing compound detection method. The preparation method of the NOBF4 modified OA-NaGdF4:Yb,Er@OA-NaGdF4:Yb,Nd comprises: 1) carrying out a co-precipitation reaction on a sodium-containing alkalinecompound, 1-octadecene, oleic acid, a neodymium source, an ytterbium source, a gadolinium source, NH4F and OA-NaGdF4:Yb,Er to obtain OA-NaGdF4:Yb,Er@OA-NaGdF4:Yb,Nd up-conversion nanoparticles; and 2)carrying out a contact reaction on the OA-NaGdF4:Yb,Er@OA-NaGdF4:Yb and NOBF4. According to the present invention, the nanometer probe has advantages of wide detection range, high sensitivity, good selectivity, low cost, rapid detection and the like in detection of sulfur-containing compounds.