Democrats v. GOP on trade, jobs — by the numbers

American workers want their next president to stop the flow of manufacturing employment offshore and bring "good-paying jobs" back to the U.S.

So are they better off voting for a Democrat or a Republican?

As the campaign moves through the party nomination phase, those voters will be sizing up the two major candidates, in part, based on how well their respective parties have done in creating enough jobs to offset a half-century decline in the American middle class.

To better assess those records, CNBC.com analyzed the economic performance of the last six presidents using a variety of measures, calculating the impact of each president's term, beginning with Jimmy Carter.

Those years spanned a period of major transformation in the global economy and an expansion of world trade driven by a host of factors that include everything from lower tariffs and internet-driven supply chains to expanded airline capacity and containerized cargo shipping.

Globalization also meant U.S. markets were open to other countries, and American workers had to compete with cheap offshore labor. One of the biggest single events that opened those floodgates was the North American Free Trade Agreement, which created a unified trade bloc with the two biggest U.S. trade partners, Mexico and Canada.

NAFTA also produced a massive shift in the nation's trade balance — the difference between how much stuff American workers make and sell to the rest of the world and how much stuff American consumers and businesses buy from other countries.

In 1992, another "billionaire businessman" based his third-party presidential candidacy on, among other issues, the "giant sucking sound" of jobs flooding to Mexico.

Trump has echoed that appeal to voters in this year's presidential campaign with a pledge to wall off the southern border and deport anyone in the U.S. without legal status.

But the data show that the "giant sucking sound" has largely faded.

After decades of being roughly in balance, American imports began to overtake exports during the Clinton administration. That gap widened sharply during the George W. Bush administration. The Great Recession threw cold water on both imports and exports, but the balance has been relatively stable during President Barack Obama's eight years in office.

The agreement took effect on Jan. 1, 1994, after Democrat Bill Clinton and his wife Hillary, the presumptive Democratic nominee in this year's election, had moved into the White House. (The Clintons supported the agreement, which has now become a political liability for Hillary Clinton in her current presidential bid.)

But the GOP rightly deserves both credit and blame for the impact of NAFTA on American workers. The now-controversial deal was negotiated during the George H. W. Bush administration and the draft of it was initialed by Bush just a month before he lost the election to Clinton.

Trade agreements like NAFTA have created a windfall for American consumers in the prices they pay for a wide range of goods produced by offshore workers, some of whom make a fraction of the average hourly U.S. wage. But the removal of trade barriers over the last 40 years has also destroyed millions of U.S. factory jobs, once the main source of a decent living for a shrinking middle class.

For generations of American households, a job producing goods — making things — also provided a solid income for workers who lacked the skills or education now required to land one of the millions of new jobs created by a global, information-driven economy.

Millions of those workers feel left behind, hoping that a new president will restore the traditional path to middle-class prosperity.

But the data suggest that the voters' paychecks are already gaining ground.

Adjusted for inflation, the average hourly earnings of "production and nonsupervisory employees" — a category that includes about 4 out of 5 American workers — peaked in the Carter administration as rampant price increases eroded the buying power of every dollar.

That decline continued, even after the inflation fever broke in the early 1980s, until the end of Democrat Bill Clinton's second term, when a booming economy and tight labor market pushed wages higher.

That trend continued into George W. Bush's first term. But real wage growth stalled through the rest of his administration.

The financial crisis of 2008 and the Great Recession destroyed millions of American paychecks. But for those who held onto a job, a sharp drop in the inflation rate gave them a little-noticed boost in buying power. So, in "real" terms, they got a raise, even if their employer didn't increase their weekly wage.

As the economy fell deeper into recession, real wages began falling again through President Obama's first term. But as companies began hiring again, and the demand for workers picked up, so did wages. In the last two years, as the jobless rate has fallen to half the Great Recession peak, wages measured based on their real buying power have recovered to levels not seen since the Carter administration.