The suitability of groundwater and agricultural products for human consumption requires determining levels and assessing the health risks associated with potential pollutants. Here, particularly pollution with nitrate still remains a challenge, especially for those urban areas suffering from insufficient sewage collection systems, resulting in contaminating soil, endangering food safety, and deteriorating drinking water quality. In the present study, nitrate concentrations in the commonly consumed fruit and vegetable species were determined, and the results, together with the groundwater nitrate levels, were used to assess the associated health risks for Mashhad city residents. For this assessment, 261 water samples and 16 produce types were used to compute the daily intake of nitrate. Nitrate in groundwater was analyzed using a spectrophotometer, and produce species were examined using High-Performance Liquid Chromatography. Ward’s hierarchical cluster analysis was applied for categorizing produce samples with regard to their nitrate content. Additionally, to account for the sanitation hazards associated with groundwater quality for drinking purposes, total coliform and turbidity were also assessed using the membrane filter (MF) technique and a nephelometer, respectively. Nitrate concentrations exceeded the prescribed permissible limits in 42% of the groundwater wells. The outcomes also exhibit significantly higher nitrate accumulation levels in root-tuber vegetables and leafy vegetables compared to fruit vegetables and fruits. Using cluster analysis, the accumulation of nitrate in vegetables and fruits was categorized into four clusters, specifying that radish contributes to 65.8% of the total content of nitrate in all samples. The Estimated Daily Intake (EDI) of nitrate and Health Risk Index (HRI) associated with consumption of groundwater exceeded the prescribed limit for the children’s target group in Mashhad’s south and central parts. Likewise, EDI and HRI values for produce consumption, in most samples, were found to be in the tolerable range, except for radish, lettuce, and cabbage, potentially posing risks for both children and adult consumers. The total coliforms in groundwater were found to violate the prescribed limit at 78.93% of the sampling locations and were generally much higher over the city’s central and southern areas. A relatively strong correlation (R2 = 0.6307) between total coliform and nitrate concentrations suggests the release of anthropogenic pollution (i.e., sewage and manure) in the central and southern Mashhad.