We suggest a simple scheme for automatically determining the width parameter of smearing methods of the Brillouin zone integration in electronic structure calculation. The scheme retains one free parameter that at any time can be eliminated by choosing a denser k-space mesh until the desired accuracy is obtained. The tests are carried out in the context of Methfessel-Paxton smearing. This adaptive Gaussian smearing (AGS) is easily implemented, variational with respect to partial occupancies and free from spurious occupancies that are negative or larger than one. Its convergence properties are similar to those obtained with the modified tetrahedron method for energy resolution of ≥0.1 meV.