Millions of Americans drink potentially unsafe tap water. How does your county stack up?

Tainted tap water isn’t just a problem in Flint, Michigan. In any given year from 1982 to 2015, somewhere between 9 million and 45 million Americans got their drinking water from a source that was in violation of the Safe Drinking Water Act, according to a new study. Most at risk: people who live in rural, low-income areas.

In general, “the U.S. has really safe water,” says Maura Allaire, a water economist at the University of California, Irvine, and lead author of the new study. Still, problems with drinking water crop up every year, and in some municipalities, year after year. The contaminants in the water can cause stomach flu or “more chronic conditions including a variety of cancers and neurological disorders,” she says.

For more than 3 decades, the U.S. Environmental Protection Agency (EPA) had been compiling information about water quality violations across the country—but no one had published a national assessment looking at long-term trends in those data. Allaire and her colleagues downloaded EPA’s data and looked at the number of health-related water quality violations for 17,900 community water systems in the continental United States over a 34-year period. Some were for elevated lead levels, the problem in Flint, but the data set also included violations for coliform bacteria—a group of microbes that is easy to detect and serves as an indicator of bacterial contamination in general—nitrates, arsenic, and other contaminants. The researchers combined those data with information from the U.S. census such as housing density and average household income, to figure out which communities were most vulnerable. Read more.