Abstract: It is shown that the quantization of the Hall conductivity of two- dimensional samples, which has been observed previously by Von Klitzing et al., 1980 and by Tsui et at., 1982, is a consequence of gauge invariance and the existence of a mobility gap. It is clear that extended and localized levels have important role in explaining of QHE. Within our work, the gauge invariance has been used in the case of impurity potentials. Other possible sources of deviation are briefly examined.