The study aims to investigate the accumulation characteristics of heavy metals in soils during soil formation in carbonate rock regions. Taking Hangzhou City as an example, the carbonate rocks are divided into three categories according to the lithology of the parent rock: pure carbonate rocks (including limestone and dolomitic limestone), carbonaceous carbonate rocks (including carbonaceous limestone and interbedded rocks of limestone and carbonaceous mud shale), and other impurity-bearing carbonate rocks (including argillaceous limestone, siliceous limestone, and interbedded rocks of limestone and argillaceous shale). Soil samples and their corresponding parent rock samples were collected simultaneously, and the contents of elements such as arsenic (As), cadmium (Cd), and mercury (Hg) were analyzed. The quantification of As, Cd, and Hg was performed using atomic fluorescence spectrometry (AFS), graphite furnace atomic absorption spectrometry (GFAAS), and cold vapor atomic absorption spectrometry (CVAAS), respectively. Iron (Fe), aluminum (Al), calcium (Ca), and magnesium (Mg) were analyzed by X-ray fluorescence spectrometry (XRF). The results showed that the contents of As, Cd and Hg in the soils varied greatly due to the changes in the lithology of parent rocks, and followed the order: pure carbonate rock soil>carbonaceous limestone soil>argillaceous limestone soil. The average enrichment factors of soil As, Cd and Hg were 7.72, 10.05, and 6.17, respectively. The enrichment coefficients of As, Cd, and Hg in soil were positively correlated with the total content of calcium oxide and magnesium oxide in the parent rock and soil pH. The contents of As, Cd, and Hg in the soil developed from carbonaceous carbonate rocks were close to or slightly lower than those in their parent rocks (with average enrichment coefficients of 1.01, 0.91 and 0.92 respectively), and were less affected by the total content of calcium oxide and magnesium oxide in the parent rocks. The contents of As, Cd, and Hg in the soil developed from carbonate rocks containing other impurities were slightly higher than those in the corresponding parent rocks, with a relatively low enrichment degree (with average enrichment coefficients of 1.20, 1.64 and 1.29 respectively), and showed a slight positive correlation with the total content of calcium oxide and magnesium oxide in the parent rocks. The chemical forms of cadmium in soils developed from different parent rocks also showed certain differences. During the soil formation process of pure carbonate rocks, there was a significant enrichment of heavy metals; in the soils developed from carbonaceous carbonate rocks, heavy metals had inheritability and there was a slight leaching of heavy metals during the soil formation process; in the soils developed from carbonate rocks containing other impurities, heavy metals had both inheritability and enrichment, but the degree of enrichment was relatively low during the soil formation process.