Hydrogen atoms inside of an Mg-doped GaN epitaxial layer were effectively removed by the electrochemical potentiostatic activation (EPA) method. The role of hydrogen was investigated in terms of the device performance of light-emitting diodes (LEDs). The effect of the main process parameters for EPA such as solution type, voltage, and time was studied and optimized for application to LED fabrication. In optimized conditions, the light output of 385-nm LEDs was improved by about 26% at 30 mA, which was caused by the reduction of the hydrogen concentration by $35%. Further removal of hydrogen seems to be involved in the breaking of Ga-H bonds that passivate the nitrogen vacancies. An EPA process with high voltage breaks not only Mg-H bonds that generate hole carriers but also Ga-H bonds that generate electron carriers, thus causing compensation that impedes the practical increase of hole concentration, regardless of the drastic removal of hydrogen atoms. A decrease in hydrogen concentration affects the current-voltage characteristics, reducing the reverse current by about one order and altering the forward current behavior in the low voltage region. V C 2015 AIP Publishing LLC. [http://dx.