CIVILISATION works only if those who enjoy its benefits are also prepared to pay their share of the costs. People and companies that avoid tax are therefore unpopular at the best of times, so it is not surprising that when governments and individuals everywhere are scrimping to pay their bills, attacks are mounting on tax havens and those that use them.

In Europe the anger has focused on big firms. Amazon and Starbucks have faced consumer boycotts for using clever accounting tricks to book profits in tax havens while reducing their bills in the countries where they do business. David Cameron has put tackling corporate tax-avoidance at the top of the G8 agenda. America has taken aim at tax-dodging individuals and the banks that help them. Congress has passed the Foreign Account Tax Compliance Act (FATCA), which forces foreign financial firms to disclose their American clients. Any whiff of offshore funds has become a political liability. During last year’s presidential campaign Mitt Romney was excoriated by Democrats for his holdings in the Cayman Islands. Now Jack Lew, Barack Obama’s nominee for treasury secretary, is under fire for once having an interest in a Cayman fund.

Getting rich people to pay their dues is an admirable ambition, but this attack is both hypocritical and misguided. It may be good populist politics, but leaders who want to make their countries work better should focus instead on cleaning up their own back yards and reforming their tax systems.

Dodgy of Delaware

The archetypal tax haven may be a palm-fringed island, but as our special report this week makes clear, there is nothing small about offshore finance. If you define a tax haven as a place that tries to attract non-resident funds by offering light regulation, low (or zero) taxation and secrecy, then the world has 50-60 such havens. These serve as domiciles for more than 2m companies and thousands of banks, funds and insurers. Nobody really knows how much money is stashed away: estimates vary from way below to way above $20 trillion.

Not all these havens are in sunny climes; indeed not all are technically offshore. Mr Obama likes to cite Ugland House, a building in the Cayman Islands that is officially home to 18,000 companies, as the epitome of a rigged system. But Ugland House is not a patch on Delaware (population 917,092), which is home to 945,000 companies, many of which are dodgy shells. Miami is a massive offshore banking centre, offering depositors from emerging markets the sort of protection from prying eyes that their home countries can no longer get away with. The City of London, which pioneered offshore currency trading in the 1950s, still specialises in helping non-residents get around the rules. British shell companies and limited-liability partnerships regularly crop up in criminal cases. London is no better than the Cayman Islands when it comes to controls against money laundering. Other European Union countries are global hubs for a different sort of tax avoidance: companies divert profits to brass-plate subsidiaries in low-tax Luxembourg, Ireland and the Netherlands.

Reform should thus focus on rich-world financial centres as well as Caribbean islands, and should distinguish between illegal activities (laundering and outright tax evasion) and legal ones (fancy accounting to avoid tax). The best weapon against illegal activities is transparency, which boils down to collecting more information and sharing it better. Thanks in large part to America’s FATCA, small offshore centres are handing over more data to their clients’ home countries—while America remains shamefully reluctant to share information with the Latin American countries whose citizens hold deposits in Miami. That must change. Everyone could do more to crack down on the use of nominee shareholders and directors to hide the provenance of money. And they should make sure that information about the true “beneficial” owners of companies is collected, kept up-to-date and made more readily available to investigators in cases of suspected wrongdoing. There are costs to openness, but they are outweighed by the benefits of shining light on the shady corners of finance.

Want more tax? Lower the tax rate

Transparency will also help curb the more aggressive forms of corporate tax avoidance. As Starbucks’s experience has shown, companies that shift money around to minimise their tax bills endanger their reputations. The more information consumers have about such dodges, the better.

Moral pressure is not the whole answer, though: consumers get bored with campaigns, and governments should not bash companies for trying to reduce their tax bills, if they do so legally. In the end, tax systems must be reformed. Governments need to make it harder for companies to use internal (“transfer”) pricing to avoid tax. Companies should be made to book activity where it actually takes place. Several federal economies, including America, already prevent companies from exploiting the differences between states’ rules. An international agreement along those lines is needed.

Governments also need to lower corporate tax rates. Tapping companies is inefficient: firms pass the burden on to others. Better to tax directly those who ultimately pay—whether owners of capital, workers or consumers. Nor do corporate taxes raise much money: barely more than 2% of GDP (8.5% of tax revenue) in America and 2.7% in Britain. Abolishing corporate tax would create its own problems, as it would encourage rich people to turn themselves into companies. But a lower rate on a broader base, combined with vigilance by the tax authorities, would be more efficient and would probably raise more revenue: America, whose companies face one of the rich world’s highest corporate-tax rates on their worldwide income, also has some of the most energetic tax-avoiders.

These reforms would not be easy. Governments that try to lower corporate tax rates will be accused of caving in to blackmailing capitalists. Financial centres and incorporation hubs, from the City of London to Delaware, will fight any attempt to tighten their rules. But if politicians really want to tax the missing $20 trillion, that’s where they should start.