Here's an international money riddle for you: What country is smaller than Rhode Island yet is the most attractive place for companies and investors to park their money behind the United States?
Ireland? Cayman Islands?
The little grand duchy tucked away in the heart of Europe saw about $95 billion moved into the country from U.S. companies in 2012 alone, according to the most recent data from the U.S. Bureau of Economic Analysis. Direct investment from the U.S. into Luxembourg in 2013 was $416 billion. More than 200 U.S. companies operate there.
But these gains are bringing controversy. Critics argue the country's success is based on accounting practices that lure multinationals with the promise of being able to shield profits from taxes. That works to the detriment of taxpayers in other countries, particularly the United States, and makes Luxembourg's European neighbors look less competitive.
For its part, Luxembourg says it's an attractive place for multinationals to operate for a variety of reasons, including political stability, fiscal policy and labor tranquility. It rejects the notion that it has simply become a popular tax haven, adept at helping companies dodge their tax bills.
Brian Rowbotham, a tax expert with more than 35 years of experience who has helped companies set up similar tax structures in Luxembourg and elsewhere, said jurisdictions like Luxembourg "are clearly enabling global enterprises to shift vast amounts of revenue offshore, thereby screwing the bricks-and-mortar countries out of vast sums of tax revenues, while untaxed profits are kept offshore."
"It's a boondoggle at the taxpayers' expense," Rowbotham said in an interview with CNBC. Experts agree that there is nothing illegal going on and that companies are simply using Luxembourg's lax tax laws for the benefit of their shareholders, as would be expected.
The difference between Luxembourg and other tax havens? The kinds of structures companies set up to cut their tax bills has never been made public—until now.
In a partnership with the International Consortium of Investigative Journalists, CNBC was able to access nearly 550 tax rulings from about 340 companies, getting a look into how the likes of Amazon, Shire, Verizon, FedEx, Mylan and many others use Luxembourg to save billions of dollars by paying lower taxes or avoiding paying them altogether. CNBC commissioned the help of international tax attorneys and experts to explain Luxembourg's tax structures that make the tiny nation such an attractive place for multinationals to park their money.
The leaked documents cover rulings and strategies implemented from 2002 to 2010 and were first reported by French journalist Edouard Perrin in two documentaries in 2012. But CNBC and the consortium have taken the first deep look at the documents.
The accounting firm PricewaterhouseCoopers, which has built a thriving tax business in Luxembourg, represented all of the companies in the leaked documents. Luxembourg has a population of more than 500,000, of which 2,300 are PwC employees. PwC in Luxembourg posted a video in October 2013 in which Managing Partner Didier Mouget boasted that the tax practice grew by about 15 percent in 2013.
"We've brought on board over 550 new recruits from 35 different countries ... reinforcing our position as one of the largest employers in the country," Mouget said. "We expect to recruit over 600 new employees in 2014."
As for its business with clients in Luxembourg, PricewaterhouseCoopers said it is "prohibited from commenting on specific client matters, but we reject any suggestion that there is anything improper about the firm's work."
"CNBC has asked PwC to comment on a proposed story sourced from documents that, if authentic, were taken unlawfully by a former employee of the Luxembourg firm who then selectively provided them to the media," PwC added. "It is not surprising that, without a full set of authentic documents or a complete understanding of the structures involved, some in the media would use these dated documents to draw false conclusions about their purpose and impact."
Preapproved tax status: Luxembourg's tax rate is technically about 29 percent, but many companies end up paying little or no taxes by first consulting with tax ministers to get a tax ruling approved.
The ruling is meant to give the green light to setting up a company structure that would allow for the least possible amount of taxes.
That practice of preapproval is one thing that could potentially draw the ire of wealthy nations, many of which are members of the Organization for Economic Cooperation and Development. An OECD spokesman confirmed to CNBC that "under certain conditions," it is possible to get a Luxembourg tax ruling in advance.
That would essentially be the equivalent of a foreign firm coming to the United States and arranging its tax burden with the IRS in advance.
Operating through subsidiaries: In order to save money, most U.S. companies that operate in Luxembourg do so by setting up subsidiaries, taxable under Luxembourg law as either partnerships or corporations.
In turn, the subsidiary can act as a holding company for European or other subsidiaries. The global, parent company is then allowed, in effect, to lend money to itself and is not subject to a tax on the interest payment, thereby lowering its overall tax burden.
The difference between setting up shop in Luxembourg and keeping everything in the U.S.? Tax expert Rowbotham provides a hypothetical example:
If a company incorporated in, say, Singapore charged a license fee to an American company for U.S. software, 30 percent of the revenue paid to the Singapore company would be withheld and paid to the U.S. Treasury. In the case of a company based in Luxembourg, there is zero withholding tax.
After analyzing the PwC documents, international tax attorney Steven Plotnick, who has decades of experience helping clients set up similar structures, said firms establishing tax structures in Luxembourg sometimes achieve significant tax reductions.
For example, the Luxembourg tax on $50 million of interest income running through the country via back-to-back loans would be less than $100,000. By comparison, the tax in the United States would range from $6 million to $18 million.
"For the most part, what you have are Luxembourg companies with no tangible activities that are simply either borrowing money from a tax haven entity and relending money to related companies and/or holding shares in subsidiaries," said Plotnick, an adjunct professor at New York Law School.
If the loans to the operating companies are legitimate, those companies will be entitled to a deduction for interest expense.
So in effect, European and other nations see billions of dollars being deducted as interest expense paid to Luxembourg entities, but no company is paying tax on the interest income—effectively escaping taxation, he said.
"Secondly—in the case of dividends paid by a subsidiary to its Luxembourg parent, if structured properly, neither Luxembourg nor the country in which the subsidiary was formed will tax the dividend, effectively avoiding tax by taking advantage of Luxembourg's status as an EU nation and its wide tax treaty network," Plotnick said.
As a result of all these questions regarding how it structures taxes, Luxemboug has come under pressure from its neighbors. A spokesman for Luxembourg's Minister of Finance Pierre Gramegna told CNBC that he strongly rejects the assertion that Luxembourg is a tax haven and said that his country fully complies with European and international law in tax matters.
"Luxembourg is actually on the forefront of the move towards greater transparency in tax matters," the spokesman said in a statement. "Our financial center is well regulated by the CSSF (our supervising authority for the financial sector), as well as by the Luxembourg and European central banks. Our tax rates are comparable to those of our neighboring countries."
Indeed, Plotnick reiterated what other experts told CNBC—these rulings do not show any illegal activity but instead demonstrate just how financially sound it is for companies to do business there.
"Luxembourg has a system, where in effect they tell everybody in advance, if you come here and you set up this loan structure, we won't tax it," he said.
Any question of alleged unfair tax practices is more a matter of whether Luxembourg is sufficiently transparent rather than if it's a tax haven per se, according to the spokesman for the OECD. Since 2000, that organization looks primarily at whether a country is open about its policies and cooperates with tax authorities.
"Regardless of the major economic services that are offered in Luxembourg, that country has committed to implementing the international standard, and undergoes the review process," the spokesman said.
"Considering the number and importance of the issues found during the review, Luxembourg was assigned an overall rating of 'non-compliant' ... in October 2013," the spokesman said.
"Generally, peer review reports make recommendation(s) to solve the issues raised, but no changes are proposed as such, it is for the jurisdiction to decide how to address the recommendations."
The former prime minister of Luxembourg, Jean-Claude Juncker, is often credited with setting up the very tax structure that is now being investigated.
In a twist of irony, Juncker is now the president of the European Commission, a branch of the same organization currently looking into Luxembourg's practices.
Juncker declined CNBC's request for an interview; however, a spokeswoman sent this statement:
"While recognizing the competence of member states for their taxation systems, we should step up our efforts to combat tax evasion and tax fraud, so that all contribute their fair share. I will notably press ahead with administrative cooperation between tax authorities and work for the adoption at EU level of a Common Consolidated Corporate Tax Base and a Financial Transaction Tax."
Big, international companies from a variety of industries operate tax structures within Luxembourg, including some very "American" brands.
Amazon has formed a Luxembourg intangible holding partnership that owns various European patents. It also charges royalties to Amazon EU, a Luxembourg corporation, for the use of those intangibles. In turn, Amazon EU appears to sublicense the right to use those intangibles to European affiliates, which pay the entity royalties, according to international tax expert Steven Plotnick.
The effect of this in 2010 was that European affiliates paid 286 million euros to Amazon EU, which Plotnick said was presumably deductible in Luxembourg. Amazon EU then paid to the parent company 519 million euros, leaving the Luxembourg corporation with a tax bill of 4 million euros, or only 0.77 percent.
Amazon did not return CNBC's request for comment. In a statement after the European Commission announced an investigation into Amazon's arrangements with Luxembourg, the company said "Amazon has received no special tax treatment from Luxembourg, we are subject to the same tax laws as other companies operating here."
Following the financial engineering trail is tricky. Take Ireland-based biopharma company Shire. A subsidiary of Shire in effect loaned money to itself by lending funds to its Luxembourg branch (i.e., Luxembourg permanent establishment or "PE"), and the branch in turn loaned these funds to other subsidiaries, according to Plotnick.
From a Luxembourg perspective, the interest income is almost entirely offset for tax purposes by the interest paid by the PE to its Irish headquarters. Ireland, however, does not tax the interest received by the branch, and as the company as a whole is treated as a "tax unity" there is also no interest income realized by the Irish company when the PE pays interest to the Ireland HQ. The income thereby escapes almost all taxation, Plotnick said.
Shire views the issue another way.
A Shire spokeswoman said Shire Holdings Europe No. 2 Sarl, a Luxembourg company, is part of its overall treasury operations.
"We have a responsibility to all our stakeholders to manage our business responsibly; this includes managing our tax affairs in the interests of all stakeholders," she said, adding, "We comply fully with Luxembourg tax law based on our activities there and with all relevant tax legislation in the countries in which we operate. We do not comment on individual aspects of our operations. Our overall tax position is fully disclosed in our quarterly and annual reports."
Shire isn't the only drug industry player in the Luxembourg tax game. Pharmaceutical giant Mylan has set up a structure in which subsidiaries also pay interest to a Luxembourg lender, which in turns pays interest to a tax haven, such as a Gibraltar- incorporated lender, and is thus able to lower the tax bills, Plotnick said.
Mylan told CNBC it would not comment.
A FedEx holding company was established in which any dividends received by a Luxembourg company from FedEx's specified foreign subsidies in places including Mexico and Europe would be exempt from a Luxembourg tax. The dividends could then be further remitted to its Hong Kong parent tax free under the terms of a tax treaty.
"Apparently the Mexican tax rate is sufficient to allow a Luxembourg company to receive dividends from FedEx Mexico without Luxembourg income tax," Plotnick told CNBC.
But FedEx sees things differently.
FedEx spokesman Jess Bunn told CNBC that the company serves more than 220 countries and territories around the world and is often required to establish legal entities in many of them.
"FedEx typically uses cash generated overseas to fund these investments and, therefore, maintains a holding company located in Luxembourg to manage our investments in several foreign operating companies," Bunn said.
"FedEx has not utilized its holding company to reduce the tax base of a country and, as disclosed in our publicly available financial statements, simply uses the structure to permanently reinvest its offshore earnings by investing in and managing our investments in foreign operating companies."
Plotnick said the structure that is used to "permanently reinvest" offshore earnings results in millions of dollars of interest income paid by subsidiaries to the Luxembourg company to permanently avoid any income taxation of significance.
Documentation based on a 2009 tax ruling, in accordance with PricewaterhouseCoopers in Luxembourg, showed that through a Dutch subsidiary, Verizon completed a capitalization that converted $1 billion of equity into $1 billion of debt, effectively escaping nearly all European taxation, Plotnick said.
Verizon spokesman Bob Varettoni told CNBC that the company pays its fair share of taxes in every country where it has operations and that approximately 97 percent of Verizon's total revenues of more than $120 billion last year were subject to tax in the U.S.
"The transaction you are asking about—the one involved in the 2009 tax ruling—increased Verizon's European tax payments by a minimal amount, so the premise that we avoided taxes is incorrect," Varettoni said.
It's again a very complicated tax story reduced to a battle over semantics.
"This transaction was related to the consolidation of inherited inter-company debt at the former MCI companies," Varettoni said. "We did this to eliminate the impacts of foreign exchange rate volatility during a particularly uncertain time in the global economy. As part of that effort, we transferred certain intercompany receivables in the U.K. to the Luxembourg holding company. However, this did not reduce our tax obligation in the U.K. or The Netherlands, and it actually increased our tax obligation in Luxembourg."