A New York professor whose formula has proven accurate in every presidential election but one since 1912 says Donald Trump has a 97.6 percent chance — or better — of taking the White House if he’s the Republican nominee.

Political-science Professor Helmut Norpoth, of Stony Brook University on Long Island, created a statistical model for presidential elections using candidates’ primary results and other data to predict the victors, and he’s making Trump an all-but-sure thing this year.

The prediction wizard told university alumni gathered in Manhattan Monday night that Trump has a 97 percent chance of beating Hillary Clinton and a 99 percent chance of stomping Bernie Sanders, according to the school’s newspaper, The Statesman.

“The bottom line is that the primary model, using also the cyclical movement, makes it almost certain that Donald Trump will be the next president if he’s a nominee of the [Republican] party,” Norpoth said at the SUNY Global Center in Midtown.

The professor’s formula measures each candidates’ performance in primaries and caucuses to gauge party unity and voter excitement.

One major assumption is that a party that has held the Oval Office for two consecutive terms is less likely to win another term.

Norpoth applied his model, which he created in 1996, to every presidential election going back to 1912, and it worked for every one — with the exception of 1960, when John F. Kennedy narrowly defeated Richard Nixon.

“When I started out with this kind of display a few months ago, I thought it was sort of a joke,” Norpoth said of his 2016 results.

“Well, I’ll tell you right now, it ain’t a joke anymore.

“You think, ‘This is crazy. How can anything come up with something like that?’ ” Norpoth told the audience.

“But that’s exactly the kind of equation I used to predict Bill Clinton winning in ’96, that I used to predict that George Bush would win in 2004, and, as you remember four years ago, that Obama would win in 2012,” he said.

The probability of a Trump win is “almost ‘take it to the bank,’ ” he said.