Groundwater pollution in the Pingshuo mining area is strongly associated with mining activity, with heavy metals (HMs) represent predominant pollutants. To achieve accurate information about the pollution status and health risks of groundwater, 189 groups of samples were collected, tested and analyzed for HMs. The results showed that Fe, Mn, and Zn had the highest average concentrations across various types of groundwater. The concentration of HMs in groundwater was higher near the open pit, waste slag pile, riverfront area, and high anthropic zone. Compared with the standard threshold, except for Ordovician groundwater, excessive HMs were found in other groundwater. Fe, in particular, exceeded the threshold in 20% 75% of the groundwater samples. Three sources of HMs were identified and quantified by Pearson’s correlation analysis and the PMF model, including coal mining activities (68.22%), human life and agricultural activities (16.91%), and natural sources (14.87%). In terms of health risks, the health risk index for HMs in groundwater ranged from 0.18 to 0.42 for adults, indicating an acceptable level. Additionally, high carcinogenic risks were identified in Quaternary groundwater (95.45%), coal series groundwater (91.67%), and Ordovician groundwater (26.67%). Both carcinogenic and noncarcinogenic risks were greater for children than adults, highlighting their increased vulnerability to HMs in groundwater. This study provides a scientific foundation for managing groundwater quality and ensuring drinking water safety in mining areas.