A study of Si-doped and Mg-doped AlxGa1-xN up to × ∼ 50 % and the characteristics of ultraviolet (UV) light emitting diodes (LEDs) with emission wavelengths at 340 nm and 290 nm are reported. By using grading super-lattices (SLs) before n-type AlGaN growth, surface roughness is much improved. Resistivity of 2.9×10-2 Ωcm and free electron concentrations of 2.9×10 cm- are achieved for n-type Al0.45Ga0.55N. The viability of effective p-type doping is defined by a minimum concentration of Mg required to offset the background impurities and, more importantly, a maximum limit above which inversion domains and structural defects start to nucleate, accompanied by a rapid degradation of electrical transport. Resistivity of 10 Ωcm and free hole concentrations above 1017 cm−3 are achieved for AlxGa1-xN up to × ∼ 50 % within an optimum window of Mg incorporation. Output powers up to 1.5 mW from small area 340 nm LEDs (< 100 μm diameter) and 110 μW from 290 nm LEDs (100 μm diameter) directly off a planar chip have been achieved under DC condition. For large area encapsulated lamp (1×1 mm2 device area and 0.52 mm2 mesa area), output power of 79 mW from 340 nm LEDs and 8.5 mW from 290 nm LEDs are achieved under pulse mode (1kHz, 2% duty factor).