CNBC Explains

How the Gingrich-Edwards tax loophole works

John Edwards and Newt Gingrich.
Getty Images

As part of his budget for 2015, President Barack Obama has called for ending what's become known as the "Gingrich/Edwards" tax loophole. The loophole allows self-employed people who set up so-called S corporations to avoid paying taxes into Social Security and Medicare.

In a 2009 report, the Government Accountability Office said that people who used the loophole underreported about $23.6 billion in compensation in 2003 and 2004.

We'll get into why the loophole has the label from two well-known politicos, but before we do, let's look at how it works.

$900,000 untaxed

It's important to note that the loophole is legal and used quite often, said Edward Rigby, a business tax expert at the accounting firm ParenteBeard. It's just a matter of degree on how it's used.

(Read more: How to maximize your Social Security)

So, let's say someone has set up their own S corporation, in this case a consulting firm, and makes $1 million for the year advising their clients. An S corporation is one that elects to pass corporate income, losses, deductions and credits through to its investors and shareholders for federal tax purposes. Many owners of S corporations classify themselves as investors and shareholders.

To use the loophole, that person will treat only $100,000 of that $1 million as personal wages. The other $900,000 is treated as company profits—not salary—even though the person, as owner, will get the money. (The $900,000 is not tax-free. It is subject to distribution taxes.)

That allows the business owner to avoid paying payroll taxes into Social Security and Medicare by some $26,000. By using the loophole, the person is declaring that he or she is more of an investor than an active employee of their own company.

(Read more: Cheat on taxes? Never! (Really)

"The red flag for the IRS would be if they think someone's work salary is too low in regards to compensation for services offered," said ParenteBeard's Rigby. "Then there would be some back taxes owed."

Controversy around S corporations has in recent years ensnared two prominent politicians, both of whom have seen their names attached to the loophole—usually by their political opponents. (Neither man's office responded to multiple inquiries that were made by CNBC.)

The Edwards connection

Before former senator and vice presidential candidate John Edwards, D-N.C., joined the senate in 1999, he earned millions as a trial lawyer. In 1997 alone, he made more than $26 million.

Despite the high income, Edwards paid himself a salary of $360,000 each year from 1995 to 1999 and took the rest as distributions from his S corporation. That saved Edwards an estimated nearly $600,000 in payroll taxes for those years.

The information about Edwards came out during the 2004 presidential campaign, with the release of his tax returns when he ran as the Democratic vice presidential nominee to presidential candidate, former senator and now Secretary of State John Kerry.

It was during the campaign that Edwards attacked President George W. Bush as favoring the wealthy with his tax policies and blamed tax shelters for undermining the Medicare program.

The Kerry-Edwards team said at the time that Edwards created the tax shelter on the advice of his accountant, who cited its legal liability protections as well as its tax advantages, about two years after he left a larger firm to start his own practice with a partner.

The loophole had been called the "John Edwards" loophole until 2010, when it scooped up another presidential candidate and took on a more bipartisan tone.

Pres. Obama unveils 2015 budget plan
VIDEO1:5001:50
Pres. Obama unveils 2015 budget plan

Newt Gingrich

In 2010, former speaker of the House and GOP presidential contender, Newt Gingrich, R-Ga., got paid $444,327 from his two firms, Gingrich Holdings and Gingrich Productions.

But the firms declared $2.4 million as profits of the S corporation in 2010. By declaring only the $444,327 as income and the rest as profits, it allowed Gingrich to avoid $69,000 in Medicare payroll taxes.

(Read more: Here's what Americans really do with tax refunds)

Like Edwards, this information came out during Gingrich's run in the GOP presidential primary campaign of 2012, when the former speaker released his tax returns. But he never publicly commented on the loophole.

It was during the campaign that Gingrich called for a national 15 percent flat rate, with limited deductions and for privatizing some parts of Social Security and Medicare.

Neither Gingrich nor Edwards were made to pay any back taxes, but the publicity surrounding the use of it didn't help their political images.

—By CNBC's Mark Koba. Follow him on Twitter @MarkKobaCNBC.