In Pennsylvania and Florida, Clinton beats Trump by just 1 percent, and in Ohio, Trump beats Clinton by 4 percent.

The survey found large divides among voters along fault lines of race, age and gender — Trump does better among older voters, white voters and men, while Clinton is more popular among young voters, women and voters of color.

But when the survey asked about Sen. Bernie Sanders versus Trump, things weren't so close. Sanders beats Trump by at least 2 percentage points in the three swing states.