Melanin is a complex natural pigment that is widely present in fungi. The mushroomOphiocordyceps sinensishas a variety of pharmacological effects. The active substances ofO. sinensishave been extensively studied, but few studies have focused on theO. sinensismelanin. In this study, the production of melanin was increased by adding light or oxidative stress, namely, reactive oxygen species (ROS) or reactive nitrogen species (RNS), during liquid fermentation. Subsequently, the structure of the purified melanin was characterized using elemental analysis, ultraviolet-visible absorption spectrum, Fourier transform infrared (FTIR), electron paramagnetic resonance (EPR), and pyrolysis gas chromatography and mass spectrometry (Py-GCMS). Studies have shown thatO. sinensismelanin is composed of C (50.59), H (6.18), O (33.90), N (8.19), and S (1.20), with maximum absorbance at 237 nm and typical melanin structures such as benzene, indole, and pyrrole. Additionally, the various biological activities ofO. sinensismelanin have been discovered; it can chelate heavy metals and shows a strong ultraviolet-blocking ability. Moreover,O. sinensismelanin can reduce the levels of intracellular reactive oxygen species and counteract the oxidative damage of H2O2to cells. These results can help us to develop applications ofO. sinensismelanin in radiation resistance, heavy metal pollution remediation, and antioxidant use.