Density functional theory with B3LYP hybrid functional and all-electron basis set was applied to study the AlN (SWAlNNTs) and GaN (SWGaNNTs) single-walled nanotubes.The structural and electronic properties were analyzed in function of its diameter and chiralities. Additionally, the elastic and piezoelectric constants were calculated for armchair, zigzag and chiral nanotubes. The simulations showed that both, SWAlNNTs and SWGaNNTs, are easily formed from the graphene-like surface than from the respective bulk. As the diameter increases, the band gap energy also increases, but converges to the band gap energy of its precursor surface. The calculated elastic constants for bulk, graphene-like surface and nanotubes of AlN and GaN show that AlN, in all configurations, is more rigid than GaN. This effect can be related to the more pronounced ionic character of Al–N bond, which confers the stiffness of material. This stiffness affects the AlN nanotube formation, especially that with small diameter, that has the higher energy strain and formation energy for all chiralities. The AlN configurations have piezoelectric response ~ 25% greater than GaN. The AlN zigzag nanotube has the higher piezoelectric constant e11, i.e., 0.84 C/m2. Compared to AlN bulk, the e11 of nanotube is less than the e33 of its bulk, 1.44 C/m2, but is higher when compared with the others’ piezoelectric constants of bulk and surface. Therefore, although the nanotubes present the same stability in diameters above 20 A, AlN and GaN differ in their band gap energy, piezoelectric response and elastic constant, which will interfere directly with their application in electronic and piezoelectric devices, besides a possible functionalization, such as doping or molecule adsorption.