This article describes an algorithm for estimation the variance of Gaussian noise. The data is smoothed using the Savitsky-Golay polynomial filter. Absolute differences between original and smoothed data are sorted in ascending order. The initial part of this sequence is selected for analysis. The result of calculation mean value of differences can be used to estimate the variance of the noise. By selecting points for analysis, the impact of cosmic ray noise and other artifacts can be reduced. The use of the proposed method for artificial and real spectra shows the ability to effectively estimate the noise variance. The algorithm contains no user-defined parameters.