In the paper,the approach of near - infrared spectroscopy to predict olefinic hydrocarbon and aromatic hydrocarbon in gasoline has been studied. Olefinic hydrocarbon and aromatic hydrocarbon of thirty-six gasoline samples from different petroleum storage depot petroleum storage and service stations have been predicted by using the full cross validation test. Research result has shown that near - infrared spectroscopy is credible in determining olefinic hydrocarbon and aromatic hydrocarbon in gasoline and the predict result can satisfy the national standard error demand for olefinic hydrocarbon and aromatic hydrocarbon analysis.