InxGa1-xN and AlxGa1-xN alloys are used in many optoelectronic applications due to their tunable band gap, but p-type doping remains a challenge. To better understand the Mg acceptor in nitride alloys, we investigate the effects of In or Al mole fraction, growth temperature and sample thickness on the amount of un-ionized (neutral) Mg using electron paramagnetic resonance (EPR) spectroscopy. The results show that neither temperature nor thickness effects the concentration of the neutral Mg-related acceptor defects; however, the mole fraction of metal, In or Al, alters the behavior of the dopant. For InxGa1-xN, a broadening of the EPR linewidth is shown to be directly related to the presence of a nearby In and is consistent with a lowering of the acceptor level. Incorporation of Al into GaN, on the other hand, produces a systematic decrease in the concentration of neutral Mg-related acceptors as the amount of Al increases. Earlier studies indicate that the reduction is caused by incomplete hydrogen removal from the acceptor impurity. © 2014 WILEY-VCH Verlag GmbH & Co. KGaA, Weinheim.