The main protease (Mpro, 3CLpro) of SARS-CoV-2 is an attractive target in coronaviruses because of its crucial involvement in viral replication and transcription. Here, we report on the design, synthesis, and structure-activity relationships of novel small-molecule thioesters as SARS-CoV-2 Mpro inhibitors. Compounds 3w and 3x exhibited excellent SARS-CoV-2 Mpro inhibition with kinac/Ki of 58,700 M-1 s-1 (Ki = 0.0141 μM) and 27,200 M-1 s-1 (Ki = 0.0332 μM), respectively. In Calu-3 and Vero76 cells, compounds 3h, 3i, 3l, 3r, 3v, 3w, and 3x displayed antiviral activity in the nanomolar range without host cell toxicity. Co-crystallization of 3w and 3af with SARS-CoV-2 Mpro was accomplished, and the X-ray structures showed covalent binding with the catalytic Cys145 residue of the protease. The potent SARS-CoV-2 Mpro inhibitors also inhibited the Mpro of other beta-coronaviruses, including SARS-CoV-1 and MERS-CoV, indicating that they might be useful to treat a broader range of coronaviral infections.