The full potential linearized augmented plane wave (FP-LAPW) method within the framework of density functional theory has been used to study effects of strain and thickness on the electronic and optical properties of two-dimensional GaN. The band gap of monolayer and bilayer GaN under compressive in-plane strain change from indirect to direct with bond length shortening. Also, the semiconductor to semimetal transition occurs for monolayer and bilayer GaN under in-plane tensile strain with bond length elongation. It is found that the tensile and compressive strains cause the red and blue shifts in the optical spectra, respectively, for both monolayer and bilayer GaN. Applying the perpendicular strain on the bilayer GaN by decreasing the inter layer distance leads to the shift of valence band maximum towards the G point in the band structure and shift of peak positions and variation of peak intensities in ε2ðuÞ spectrum. The results show that the nlayer GaN has an indirect band gap for n < 16. The results suggest that monolayer and multilayer GaN are good candidates for application in optoelectronics and flexible electronics.