The electrical properties of W contacts to both n- and p-GaN were investigated. W contacts to p-type GaN doped with Mg to a level of 1018 cm-3 were annealed for 1 min at temperatures from 350 to 900°C. The contact resistivity was found to decrease with increasing annealing temperature parallel to an increase in the GaN sheet resistance. The contacts were rectifying after all of the heat treatments. Measurements at higher temperatures (up to 400°C) resulted in I-V characteristics becoming almost linear and a decrease in contact resistivity with temperature down to 10-2 Ω cm2. These results are attributed to the ionization of more Mg acceptors as the temperature increases. In this system thermionic emission combined with tunneling through deep energy levels was found to be the transport mechanism. W contacts to heavily Si implanted (Nd∼1020cm-3) n-GaN annealed at 750-1050°C for 10 s produced ohmic behavior with no significant dependence of the contact resistivity on the annealing temperature. The observed weak dependence of the contact resistivity on the measurement temperature is attributed to the dominance of the field emission mechanism.