Artemisinin (Qinghaosu) is an important antimalaria natural medicine containing a unique endoperoxide bridge in its sesquiterpene structure. The last phase of artemisinin biosynthesis involves conversion of dihydroartemisinic acid (DHAA) to artemisinin, and the detailed mechanism remains unclear. Based on previous experimental studies, this work investigated the possible mechanism of nonenzymatic conversion of DHAA to artemisinin and identified the most chemically plausible reaction pathway using quantum chemical computations. The rate-determining step in this pathway is acid-catalyzed oxidation of the enol by triplet O2, with an overall free energy barrier of 22.5 kcal/mol. This pathway also gives byproducts dihydroarteannuin B and dihydro-epi-arteannuin B. In addition, the nonenzymatic formation mechanism of 21 natural products from Artemisia annua was discussed in this work. These results provide fundamental knowledge of the biosynthetic processes of artemisinin and related natural products, as well as important references for semisynthesis and structural modification studies of artemisinin.