Polytypes of AlN in bulk form is systematically investigated using ab initio calculations. The calculated results imply that AlN strongly favors the 2H. However, the energy differences among 3C, 6H, 4H, and 2H structured AlN with Al‐vacancy (VAl) and N‐vacancy (VN) suggests that 4H becomes competitive with 2H in AlN with VN. Moreover, it is found that Al‐rich condition producing VN tends to relatively favor the 4H‐AlN, while the 2H‐AlN is preferable under N‐rich condition suppressing VN formation. This is consistent with experimental results. The stability of graphitic AlN is also discussed in terms of bond order and bond length. These results are compared with those of other III‐N compounds such as BN stabilizing graphitic structure, GaN, and InN favoring 2H in terms of ionicity.