A substantial reservoir of nitrogen (N) in soil poses a threat to the quality and safety of shallow groundwater, especially under extreme precipitation that hastens nitrogen leaching into groundwater. However, the specific impact of varying precipitation intensities on the concentration and sources of nitrate (NO3−) in groundwater across diverse hydrogeological zones and land uses remains unclear. This study aims to elucidate the fluctuations in NO3− concentration, sources, and controlling factors in shallow groundwater under different intensities of precipitation (extreme heavy precipitation and continuous heavy precipitation) in a typical alluvial-pluvial fan of the North China Plain by using stable isotopes (δ2H–H2O, δ18O–H2O, δ15N–NO3-, δ18O–NO3-), hydrochemical analyses and the SIAR model. Affected by extreme heavy precipitation the depleted isotopes of δ2H–H2O and δ18O–H2O in groundwater of the entire area suggested the rapid recharge of fast flow by precipitation. The enriched isotopes of δ2H–H2O and δ18O–H2O of north part in alluvial fan after continuous heavy precipitation showed the recharge of translatory flow of soil water. NO3−concentrations increased to 78.9 mg/L after extreme heavy precipitation and increased to 105.3 mg/L after continuous heavy precipitation when compared to those in normal year (56.8 mg/L) of north part of the alluvial fan. However, NO3− concentrations had slight variation after continuous heavy precipitation of south part of the fan due to the deep vadose zone. The contribution ratio of sources of NO3− in groundwater by using SIAR analysis revealed manure & sewage (MS) as the primary NO3− source (accounting for 59.7–78.1%) before extreme heavy precipitation, chemical fertilizer (CF) making a minor contribution (6.9–17.3%). Different precipitation events and land use types lead to changes in NO3− sources. Affected by extreme heavy precipitation, the contribution of MS decreased while CF increased, particularly in vegetables (26.2–28.1%) and farmland (29.2–34.7%). After continuous heavy precipitation, MS increased again, particularly in vegetables (50.0%) and farmlands (20.4–66.4%), with CF either increasing or remaining steady. This indicated that continuous heavy precipitation accelerated the leaching of nitrogen (organic manure application) stored in deep soil to groundwater and it has a larger influence on the increasing of NO3− concentrations of groundwater than extreme heavy precipitation which carried nitrogen (chemical fertilizer application) in shallow soil to groundwater by fast flow. These findings underscore the importance of considering soil chemical N stores and their implications for groundwater contamination mitigation under future extreme climate scenarios, particularly in agricultural management practices.