The Panama Papers, the biggest collection of financial documents ever leaked to journalists, has revealed the shady world of offshore tax havens.

More than 11.5 million documents were obtained by the German newspaper Sueddeutsche Zeitung — and shared with the International Consortium of Investigative Journalists — via Mossack Fonseca, an international law firm based in Panama. They reveal methods that are not illegal in and of themselves, but can cost an investor's own country plenty in tax revenue.

Here's a look at how wealthy foreign investors move money in and out of offshore companies and other structures.

Step 1: Choose a haven

There are about 60 or so offshore jurisdictions around the world to choose from. They include places like Switzerland, the Channel Islands and Liechtenstein, but many are in the Caribbean.

European principalities, as well as Caribbean and Pacific islands, are favourite tax havens.

Step 2: Create a corporation or other entity

A company or a trust is set up — or a ready-made firm — with the help of offshore investment advisers. In Panama and other tax havens, an off-the-shelf option can be approved in as little as three days for a nominal fee. Another place to park a mountain of cash is in a private foundation, a non-profit entity which can then own a corporation, adding another layer of secrecy to a tax-evasion scheme.

An off-the-shelf company can be quickly named, registered and approved, doing away with paperwork and fees. (Shutterstock)

Step 3: Create a (secret) identity

One or more "nominees" are hired to run business matters for the company or trust. These agents don't manage the money directly but act on the owner's behalf, and their names will appear on all company documents.

For extra secrecy, a tax dodger can pay front people called 'nominees' to serve, on paper at least, as the entity's directors. (Shutterstock)

Step 4: Open a bank account

The money going in and out needs a home. For extra anonymity, some tax dodgers will open a bank account in a different offshore location than where the company or trust is registered.

MoraBanc is based in Andorra, which has long been considered a tax haven. However, the European principality has been reforming its tax system in recent years. (David Ramos/Getty Images)

Step 5: Move the money

One option is to wire the money in one lump sum, but the tax department will then know that the account holder has big bucks abroad. You could also smuggle cash or wire it in amounts under the reportable $10,000 requirement. Tax cheats have also been known to get a bogus offshore company or person to sue them and then "settle" out of court for a large sum.

Scotiabank has had a branch in the British Virgin Islands since 1967. The country is a favourite destination for wealthy foreigners seeking to set up an offshore company. (CBC)

Step 6: Spend the money

This is where it gets tricky, because some of the methods involve deceit and constitute illegal tax evasion. Some wealthy bounty-builders simply relocate to their tax haven, or any place with low taxes. Others take advantage of gambling schemes. Or they try to spend the money on credit cards issued in the name of the offshore company. However, tax authorities have been known to crack down on these seemingly anonymous credit cards.

Other options for getting money out:

Insurance:

Take out an insurance policy on someone who is dying, issued by an offshore insurance company, and the payout to the recipient back home will not be taxed.

Gifts:

Gifts are tax-free, too, so another technique is to create what's known as a granny trust or inheritance trust, named for a non-resident of Canada for the benefit of Canadian resident beneficiaries.

Loans:

Canadian banks that have branches offshore and on can help repatriate funds using what's called a back-to-back loan. First, for example, a million dollars in offshore profits is put into the Canadian bank's offshore branch. A loan for the same amount is then taken out at an onshore branch back at home.

Gambling:

Winnings from gambling are not taxed in Canada, although they may have been concocted in offshore betting schemes with fixed outcomes.

Get out of jail card:

Canadian tax cheats can confess and get amnesty from criminal charges if they declare their unreported income and pay taxes owing, plus interest.