Up until now, Social Security has been a windfall for many retirees: They collected far more in benefits than they shelled out in taxes.

That's changing. Many of those retiring will have paid more into the coveted entitlement program than they will get back.

Here are the numbers:

A couple who each earned the average wage during their careers and retired in 1990 would have paid $316,000 in Social Security taxes, but collected $436,000 in benefits, according to data crunched by Eugene Steuerle, an economist at the Urban Institute.

Had that couple turned 65 in 2010, however, they would have paid $600,000 in taxes, but could expect to collect just $579,000. This is the first time in the program's history that taxes outweighed benefits for this group, a couple with average earnings.

The imbalance will get more pronounced for future generations of retirees. Couples now in their early 40s will have forked over $808,000 in Social Security taxes by the time they retire, but get back only $703,000 in benefits.

The Urban Institute included payroll taxes paid by both the employee and employer, but did not include the portion used for Social Security's disability insurance program. Since 2000, taxes for just the retirement program have totaled 10.6% -- 5.3% from the employee and the same from the employer. The levy is paid on income up to a certain threshold -- $113,700 for 2013. The institute said it adjusted its calculations for inflation plus 2%, about what a person could have traditionally realized in savings had they put the money in the bank.

So why is the shift happening now? It's because the first waves of recipients saw their promised benefits rise without sufficiently large tax increases to pay for them, Steuerle said. Rates rose significantly after the program was overhauled in 1983.

"Younger generations are paying much higher tax rates for the same benefits," he said.

Still, there are many folks who will collect more than they'll have paid. The typical American couple do not each earn the average wage during their careers since women often have lower incomes or take years off to raise children. In this scenario, the couple would receive more benefits than they pay in taxes because the wife's checks often will be based on her husband's earnings. Also, most lower-wage workers receive more in benefits than they pay in taxes.

To be clear, Social Security, created in 1935, doesn't operate like a savings account. Today's workers' taxes are funding the monthly checks being sent to today's retirees.

Related: Seniors say, 'We can't afford Social Security cuts'

When it comes to Medicare, however, virtually all Americans are getting far more than they pay in taxes, which is 2.9% on all of one's income, not including the new 0.9% surtax on high earners. The couple turning 65 in 2010 paid a scant $122,000 in Medicare taxes, but can expect to get $427,000 in benefits.

And that pattern isn't reversing any time soon ... the spread actually widens for future generations.

Though many people are now putting more into Social Security than they will take out doesn't mean the entitlement program is on sound footing. A big part of the problem is that there are fewer workers to support the growing number of retirees.

The system is now paying out more in benefits than it collects in income, with the difference coming from the so-called trust fund, the result of surplus revenue previously paid into the system. But the trust fund is set to run out in 2033, after which the program will only be able to pay about three-quarters of promised benefits, according to the Social Security trustees.

"What we are paying into the system is paying for our parents' benefits," Steuerle said. "But it's not clear what that entitles us to get from our kids."