The invention provides a preparation method of a carbon nitride / tungsten trioxide nano composite material. The preparation method comprises the following steps: (1) mixing and fusing deionized water and absolute ethyl alcohol, then stirring, adding sodium tungstate, stirring to dissolve at room temperature, adding a carbon nitride precursor, stirring, precipitating to obtain crystals, drying the crystals, grinding the crystals, and thus obtaining a white powder, wherein the carbon nitride precursor comprises urea and dicyandiamide; (2) calcining the white powder obtained in the step (1) to obtain a yellow solid, grinding the yellow solid, and collecting a yellow powder; (3) stirring the yellow powder obtained in the step (2) with HCl; and swashing away impurities, then filtering, drying, and grinding to obtain a yellow powder; and (4) calcining the yellow powder obtained in the step (3). The invention also provides the carbon nitride / tungsten trioxide nano composite material prepared by the method and an application thereof. The method is simple and easy to control, and friendly to the environment; the obtained nano composite material has high dispersion and high catalytic performance; and an electrode prepared from the nano composite material has high sensitivity.