Electron backscatter diffraction (EBSD) technique has been applied to the strain distribution measurements for GaN based heterostructures for the first time. From the results for the simple AlGaN/GaN structures on GaN substrates, it was confirmed that this method has high spatial resolution of about 80nm and gives quantitatively reasonable strain values. The EBSD technique was then applied to the heterostructures grown on Si substrates to study the role of an AlN/GaN multilayer prior to the growth of a thick GaN layer. It was clarified that there exists a compressive strain in the GaN layer, especially near the interface to the AlN/GaN multilayer. This compressive strain will be relevant to the suppression of the crack generation in the thick GaN layer.