Hydrocarbon pollution poses substantial environmental risks to water and soil. Bioremediation, which utilizes microorganisms to manage pollutants, offers a cost-effective solution. However, the role of viruses, particularly bacteriophages (phages), in bioremediation remains unexplored. This study examines the diversity and activity of hydrocarbon-degradation genes encoded by environmental viruses, focusing on phages, within public databases. We identified 57 high-quality phage-encoded auxiliary metabolic genes (AMGs) related to hydrocarbon degradation, which we refer to as virus-encoded hydrocarbon degradation genes (vHYDEGs). These genes are encoded by taxonomically diverse aquatic phages and highlight the under-characterized global virosphere. Six protein families involved in the initial alkane hydroxylation steps were identified. Phylogenetic analyses revealed the diverse evolutionary trajectories of vHYDEGs across habitats, revealing previously unknown biodegraders linked evolutionarily with vHYDEGs. Our findings suggest phage AMGs may contribute to alkane and aromatic hydrocarbon degradation, participating in the initial, rate-limiting hydroxylation steps, thereby aiding hydrocarbon pollution bioremediation and promoting their propagation. To support future research, we developed vHyDeg, a database containing identified vHYDEGs with comprehensive annotations, facilitating the screening of hydrocarbon degradation AMGs and encouraging their bioremediation applications.