By using first-principles plane-wave ultrasoft pseudopotential method based on the density functional theory, the maximally localized Wannier functions of N vacancy and Al vacancy with different charge states in wurtzite AlN are calculated. With the shape and center of the computed Wannier function, the electronic structure and the spontaneous polarization of vacancy are studied respectively. The results show that N–Al bond possesses a large ionicity. It is found that the electrons of the dangling bonds displace to the positions of vacancies in N vacancy structure, while in Al vacancy structure the electrons of dangling bonds keep away from vacancies and move to the other side of N atoms. Since the vacancy breaks the centrosymmetry of the 1010 and 1210 orientations, the polarization will be induced in these two directions, and the polarization will increase as the charge increases. In the 0001 orientation, the spontaneous polarization in N vacancy will reverse as charge increases because of the dramatic variation of the electronic structure. Contrary to N vacancy, the reversion does not occur although the spontaneous polarization of Al vacancy increases as charge increases.