Secondary ion mass spectrometry (SIMS) depth profiling has been applied to the study of the thermal annealing of ohmic contacts for high electron mobility transistors. The metallic stacks (Ti/Al/Ni/Au) were deposited over the Al(0.28)Ga(0.72)N/GaN/sapphire heterostructures and subjected to a rapid thermal annealing (850 degrees C for 30 s under N(2) atmosphere) to improve the contact performance. The surface morphology and the in-depth chemical distribution of the layered contacts were severely modified due to the treatment. These modifications have been analyzed by SIMS depth profiling and scanning electron microscopy-energy-dispersive X-ray microanalysis. The SIMS analysis conditions have been optimized to achieve simultaneously good sensitivity and to avoid ion-induced mixing effects produced by the primary beam sputtering.