The electronic behavior of AlN/GaN heterojunction is investigated at thicknesses of 1.2~4.2 nm and biaxial strain of -8%~8% based on density functional theory. The structural stability, charge distribution, electronic properties, and transport properties of the cells reveal the enhancing effects of size and strain. With the thickness decreases, the bandgap values of the cells, as low as -0.387 eV, confirm the transition in structural nature, while the individual atomic layers remain bandgaps of at least 0.3 eV in DOS. The carrier mobility enhances to 2×1012 m2/V/s. The cell with 1.2 nm thickness is weakened by 50% due to the quantum confinement effect. Under compressive strain ranging from -8% to 0%, the characteristics of heterojunctions are enhanced by an order of magnitude, in contrast, under 0%~8% tensile strain, the cells decrease slightly but for 2L cells.