Based on first-principles plane-wave ultra-soft pseudopotential method, bandgaps of Ga[Formula: see text]Al[Formula: see text]N nanowires with different diameters and different Al constituents are calculated. After the optimization of the model, the bandgaps are achieved. According to the results, the bandgap of Ga[Formula: see text]Al[Formula: see text]N decreases with increasing diameter and finally, closed to that of the bulk. In addition, with increasing Al constituent, the bandgaps of Ga[Formula: see text]Al[Formula: see text]N nanowires increase. However, the amount of the increase is lower than that of the bulk Ga[Formula: see text]Al[Formula: see text]N with the increase of Al constituent.