With the rapid development of cities in northwest China, there has been an increasing focus on groundwater pollution in plateau cities, specifically the common occurrence of nitrate pollution. The special climatic, geological, and geomorphological characteristics of plateau and river valley cities contribute to distinct groundwater chemical characteristics. Therefore, the formation and evolution process of groundwater nitrate contamination differs from that of plain cities. To explore these issues, we conducted an analysis of eight major ions in various groups of water samples obtained from rivers, springs, and groundwater in Haidong. By utilizing factor analysis and correlation analysis, we were able to identify the characteristics and formation of groundwater chemistry and nitrate pollution in Haidong. Our findings reveal that the chemical characteristics of groundwater in Haidong are primarily controlled by rock weathering, mineral dissolution, and evaporation, leading to the formation of highly mineralized groundwater. Additionally, the excessive nitrate content in certain areas is a result of domestic sewage discharge and agricultural fertilizer use, exceeding Chinese drinking water health standards. Furthermore, for cities located in valleys, the geological structure significantly impacts the nitrate content of groundwater in different regions. Areas with obstructed groundwater flow tend to have higher nitrate levels, whereas regions with unobstructed groundwater experience lower nitrate concentrations. Notably, shallow groundwater is more vulnerable to nitrate pollution compared to deep groundwater. This study holds great significance in understanding the chemical characteristics of groundwater and the formation and evolution of nitrate pollution in highland river valley cities.