The porcine epidemic diarrhea virus (PEDV) is an Alphacoronavirus (α-CoV) that causes high mortality in infected piglets, resulting in serious economic losses in the farming industry. Hypericin is a dianthrone compound that has been shown as an antiviral activity on several viruses. Here, we first evaluated the antiviral effect of hypericin in PEDV and found the viral replication and egression were significantly reduced with hypericin post-treatment. As hypericin has been shown in SARS-CoV-2 that it is bound to viral 3CLpro, we thus established a molecular docking between hypericin and PEDV 3CLpro using different software and found hypericin bound to 3CLpro through two pockets. These binding pockets were further verified by another docking between hypericin and PEDV 3CLpro pocket mutants, and the fluorescence resonance energy transfer (FRET) assay confirmed that hypericin inhibits the PEDV 3CLpro activity. Moreover, the alignments of α-CoV 3CLpro sequences or crystal structure revealed that the pockets mediating hypericin and PEDV 3CLpro binding were highly conserved, especially in transmissible gastroenteritis virus (TGEV). We then validated the anti-TGEV effect of hypericin through viral replication and egression. Overall, our results push forward that hypericin was for the first time shown to have an inhibitory effect on PEDV and TGEV by targeting 3CLpro, and it deserves further attention as not only a pan-anti-α-CoV compound but potentially also as a compound of other coronaviral infections.