Composition fluctuations in GaN:Mg have been investigated by optical transmission spectroscopy, near-field scanning optical microscopy (NSOM), and scanning Kelvin probe microscopy (SKPM). An Urbach tail is observed in the optical transmission spectrum of heavily Mg-doped GaN, with the magnitude of Urbach energy increasing with increasing compositional/potential fluctuations. From the relationship between the Urbach energy and the potential fluctuation magnitude, the spatial size of the compositional fluctuations in GaN:Mg (with the average Mg concentration of ∼4×1019 cm-3) is calculated to be 220 nm. The nanoscale compositional fluctuations are determined by NSOM and SKPM. A spatial variation of the transmission mode NSOM intensity is observed with a characteristic wavelength of ∼300 nm, which is attributed to the inhomogeneous distribution of Mg. The normalized root-mean-square (rms) fluctuation of the transmission mode NSOM intensity for heavily Mg-doped GaN is a factor of 5 greater than that for undoped GaN. Similar microstructure patterns are observed in the NSOM and surface potential images of GaN:Mg as probed by SKPM. The variation of local surface potential (on the order of 100 mV) is attributed to the same compositional fluctuations of Mg, which changes the local surface work function. The local Mg concentrations are calculated from the SKPM image. For GaN:Mg with the Mg concentration of 4×1019 cm-3, a rms value of 5.4×1019 cm-3 of the compositional fluctuations has been observed.