The race for president is too close to call, according to a poll released Wednesday that refutes previous surveys showing Hillary Clinton edging away from Donald Trump.

The Quinnipiac University poll gave Clinton 42 percent to Trump’s 40 percent, which pollsters described as a dead heat considering the 2.4 percentage-point margin of error.

In the same poll on June 1, Clinton was ahead 45 to 41 percent.

Seven percent said they didn’t know whom they’d vote for in November, while 6 percent preferred someone else and 5 percent told pollsters they will not vote at all.

When asked if either candidate would make a good president, the response was a resounding “no.”

In Trump’s case, 58 percent said he wouldn’t get the job done in the White House, while 35 percent said he would.

Clinton’s split was closer.

Fifty-three percent thought she would not make a good president and 43 percent thought she would.

Nearly two-thirds of those questioned said the presidential election has increased “hatred and prejudice in the US.”

Sixty-one percent of those polled agreed with the statement “The 2016 election has increased the level of hatred and prejudice in the US.”

“It would be difficult to imagine a less flattering from-the-gut reaction to Donald Trump and Hillary Clinton . . . This is where we are. Voters find themselves in the middle of,” said political pollster Tim Malloy.

“A mean-spirited, scorched-earth campaign between two candidates they don’t like. And they don’t think either candidate would be a good president.”

The poll, taken between June 21 and 27, sampled 1,610 registered voters.