gan layer and an n type gan layer according to the related art similarly each n type gan layer may be thin a conventional n type gan layer in other words the increase of dislocation density occurring as the un gan layer becomes thick is prevented by forming a plurality of thin un gan layers for example the first and second un gan layer 31 and 33 may have thicknesses in the range of 0 5 u03bcm to 1 u03bcm and the first and second n type gan layers 32 and 34 may have thicknesses in the range of 1 u03bcm to 1 5 u03bcm according to the first embodiment the dislocation density of the first and second n type gan layers 32 and 34 is reduced as the n type gan layers become close to the active layer 40 that is distant from the buffer layer 20 to this end the first and second un gan layers 31 and 33 and the first and second n type gan layers 32 and 34 are formed in a chamber having a higher temperature and a lower pressure while reducing the amount of tmga flowed into the chamber as the un gan layers and the n type gan layers are close to the active layer 40 further since a dislocation density may be.