The invention discloses a method using three-dimensional photonic crystals to measure potential of hydrogen (pH), and relates to a method for measuring a pH valve of solution. The method using the three-dimensional photonic crystals to measure the pH aims to solve the problem that when used for measuring the pH, an existing method is not high in accuracy, and not good in stability. The method using the three-dimensional photonic crystals to measure the pH comprises a first step of adding methacrylic acid and vinyl benzene to ultrapure water, adjusting and extracting the pH, adding potassium persulfate and carrying out stirring in an even mode, a second step of adding ultrapure water to adjust volume fraction of the solution, and placing the solution into a constant temperature box, carrying out deposition and obtaining a photonic crystal film, a third step of placing the photonic crystal film into solution with different pH values, sequentially measuring reflection spectral curves of the photonic crystal film and matching a relation curve of the wavelength of the wave peak position of the reflected light of a pH value and the photonic crystal film, and a fourth step of soaking the photonic crystal film in the solution to be measured, measuring a curve of reflectance spectrum, and inferring the pH valve of the to-be-measured solution. A device, used for preparing the photonic crystal film, of the method is simple, the film can be repeatedly used, a measured value of the pH is accurate, a measured numerical value is stable, and the method using the three-dimensional photonic crystals to measure the pH is mainly used for measurement of the pH of the solution.