One of the important problems of environmental gamma-ray spectrometry is the correction of background radiation. Part of the background radiation passes through the sample into the container before entering the detector, and some of them are absorbed or scattered by the sample material, so it is necessary to make corrections to increase the measurement accuracy. The P-type coaxial high-purity germanium detector system with 30% relative efficiency was used for gamma-ray spectrometry. In this study, the gamma spectra of the three reference materials RGU-1, RGTh-1, and RGK-1 were analyzed, as well as background correction for the same container containing air, double-distilled water, and pure silica dioxide, aluminum oxide, carbonate calcium, and iron oxide was done. The statistical analysis was performed on the basis of the Z-score for the differences between the calculated and reported activities by the International Atomic Energy Agency, which obtained the Z-score in the range of 1 and − 1.