The U.S. is making millions from Americans tossing their passports

Show me the money! Uncle Sam is raking in millions of dollars from the record numbers of Americans giving up their citizenship each year.

The U.S. government has collected about $12.6 million in fees since fall 2014, after quintupling the amount it charges for renunciations, according to a CNNMoney analysis of official data. That's more than double the total it garnered over the six previous years.

U.S. citizens and long-term residents now pay $2,350 apiece to ditch their passports or green cards, up from $450 previously.

The higher renunciation charges have come at a time when more people than ever are cutting ties to the U.S.

Last year, 4,279 Americans bid Uncle Sam farewell, up 20% from 2014. That's 18 times as many as in 2008, and the third year in a row that's set a new record.

Increasing fees is a way for the U.S. to capitalize on the rising trend, according to Dianne Mehany, a tax attorney who assists with renunciations.

"We are in a difficult economic climate, and the government is looking for any method by which to increase revenue, defray costs," she said.

The renunciation charges are far from a straightforward gain for the U.S. government's coffers, though.

The fee hike helps offset the costs for the American embassies and consulates around the world that have to process all these renunciations.

In the past, "if you had five people expatriate, it wasn't that complicated," said Chris McLemore, who handles international tax planning for expats at the law firm Butler Snow. "But if suddenly, 10 times the number of people are expatriating, you do start looking at your bottom line."

And while some U.S. citizens get slapped with a giant "exit tax" bill -- sometimes in the millions of dollars -- when they renounce, experts say it still amounts to a fraction of what the government might have generated from them in future taxes.

For expats, a higher renunciation fee is increasing the cost of what's already an expensive affair.

Even in relatively simple cases, Americans often need to spend big -- easily at least $20,000 -- hiring a team of accountants and lawyers to help with the renunciation paperwork, estimates Mehany,who works at the law firm Caplin & Drysdale.

The U.S. Foreign Account Tax Compliance Act, which requires businesses around the globe to report all assets held by Americans, seeks to recoup the hundreds of billions the U.S. says it loses each year from tax evasion.

It's aimed at fat cat tax cheats, but the law has made life more difficult for expats. Some international banks have even dumped U.S. customers rather than wrestle with the complicated law.

But getting rid of Americans doesn't mean banks can wash their hands of the situation entirely. For example, they still need to develop a process to identify new Americans looking to open accounts, according to the U.S. Treasury.