The electrical and optical properties of the hole transport layer (HTL) are critical for organic and halide perovskite solar cell (OSC and PSC, respectively) performance. In this work, we studied the effect of Mg doping on CuCrO2 (CCO) nanoparticles and their performance as HTLs in OSCs and PSCs. CCO and Mg doped CCO (Mg:CCO) nanoparticles were hydrothermally synthesized. The nanoparticles were characterized by various experimental techniques to study the effect of Mg doping on structural, chemical, morphological, optical, and electronic properties of CCO. We found that Mg doping increases work function and decreases particle size. We demonstrate CCO and Mg:CCO as efficient HTLs in a variety of OSCs, including the first demonstration of a non-fullerene acceptor bulk heterojunction, and CH3 NH3 PbI3 PSCs. A small improvement of average short-circuit current density with Mg doping was found in all systems.