As advanced semiconductor materials, GaN, AlN, and GaAlN alloys are widely used in optoelectronic devices. In order to research the optoelectronic properties of GaN, AlN, and Ga(1-)xAl(x)N with different Al component, models of GaN, Ga0.875Al0.125N, Ga0.750Al0.250N, Ga0.625Al0.375N, Ga0.500Al0.500N, and AlN were built, then the atomic structure, band structure, density of states, Mulliken charge distribution, and optical properties of the six crystals were calculated based on first principle calculations. Results show that the lattice parameters decrease while the band gap increases with the increase of Al component. The GaN, AlN, and GaAlN alloys are all semiconductors with direct band gap. The global transfer index increases with the increase of Al component. When the Al component is bigger and bigger, the absorption peak shifts to higher energy, and the threshold wavelength of Ga1-xAlxN decreases. (C) 2015 Published by Elsevier GmbH.