In developed, non-agricultural, unsewered areas, septic systems and fertilizer application to lawns and gardens represent two major sources of nitrogen to coastal groundwater, in addition to atmospheric input. This study was designed to distinguish between these two possible nitrogen sources by analyzing groundwater samples for pharmaceutical residuals, because fertilizers do not contain any of these pharmaceuticals, but domestic wastewater commonly does. In addition, several herbicides and insecticides used in lawn treatment were analyzed as indicators of nitrogen delivery to groundwater from fertilizers. Groundwater samples were taken through piezometres at shoreline sites in unsewered areas surrounding Northport Harbor and in sewered areas adjacent to Manhasset Bay (hereafter referred to as "Northport" and "Manhasset", respectively), both in northwestern Long Island, USA. Excessive nitrogen loading has led to reduced dissolved oxygen concentrations in Long Island Sound, and the groundwater contribution to the nitrogen budget is poorly constrained. The frequent detection of the anticonvulsant compound carbamazepine in groundwater samples of the Northport Harbor area (unsewered), together with the fact that few pesticides associated with lawn applications were detected, suggests that wastewater input and atmospheric input are the likely sources of nitrogen in the Northport groundwater. High concentrations of nitrogen were also detected in the Manhasset (sewered) groundwater. The low detection frequency and concentration of carbamazepine, however, suggest that the sewer system effectively intercepts nitrogen from wastewater there. The likely sources of nitrogen in the Manhasset groundwater are atmospheric deposition and lawn fertilizers, as this area is densely populated.