In this study, we examined the influence of soil properties (pH, total potassium (TK), available potassium (AK), total nitrogen (TN), total phosphorus (TP), available potassium (AP), cation exchange capacity (CEC), and soil organic carbon (SOC)), and metals (Cd, Pb, Cu, and Zn) on the density, diversity, and species composition of earthworms in the Hebei Province, North China. In total, 535 earthworms were collected from 20 sites in the study area, and belonged to three families, six genera, and ten species. Amynthas hupeiensis (39.4%) and Drawida gisti (37.8%) were the dominant species. The correlations between soil variables and earthworm composition determined using redundancy analysis indicated that SOC, TK, and AK enhanced earthworm density (total, adult, and juvenile) and species (A. hupeiensis and D. gisti) abundances. Earthworm composition remained unaffected by the metals (Cd and Pb) in the uncontaminated sites; in contrast, species were absent in areas with high metal concentrations (S19 and S20). Soil TN content was negatively and positively related to Shannon and Peilou indexes (p<0.05), respectively, indicating that TN may be pivotal in influencing earthworm diversity and species evenness. Overall, the soil properties such as K, SOC, and TN were the key variables affecting earthworm density, diversity, and species dominance.