STREET-WALKERS; kerb-crawlers; phone booths plastered with pictures of breasts and buttocks: the sheer seediness of prostitution is just one reason governments have long sought to outlaw it, or corral it in licensed brothels or “tolerance zones”. NIMBYs make common cause with puritans, who think that women selling sex are sinners, and do-gooders, who think they are victims. The reality is more nuanced. Some prostitutes do indeed suffer from trafficking, exploitation or violence; their abusers ought to end up in jail for their crimes. But for many, both male and female, sex work is just that: work.

This newspaper has never found it plausible that all prostitutes are victims. That fiction is becoming harder to sustain as much of the buying and selling of sex moves online. Personal websites mean prostitutes can market themselves and build their brands. Review sites bring trustworthy customer feedback to the commercial-sex trade for the first time. The shift makes it look more and more like a normal service industry.

It can also be analysed like one. We have dissected data on prices, services and personal characteristics from one big international site that hosts 190,000 profiles of female prostitutes (see article). The results show that gentlemen really do prefer blondes, who charge 11% more than brunettes. The scrawny look beloved of fashion magazines is more marketable than flab—but less so than a healthy weight. Prostitutes themselves behave like freelancers in other labour markets. They arrange tours and take bookings online, like gigging musicians. They choose which services to offer, and whether to specialise. They temp, go part-time and fit their work around child care. There is even a graduate premium that is close to that in the wider economy.

The invisible hand-job

Moralisers will lament the shift online because it will cause the sex trade to grow strongly. Buyers and sellers will find it easier to meet and make deals. New suppliers will enter a trade that is becoming safer and less tawdry. New customers will find their way to prostitutes, since they can more easily find exactly the services they desire and confirm their quality. Pimps and madams should shudder, too. The internet will undermine their market-making power.

But everyone else should cheer. Sex arranged online and sold from an apartment or hotel room is less bothersome for third parties than are brothels or red-light districts. Above all, the web will do more to make prostitution safer than any law has ever done. Pimps are less likely to be abusive if prostitutes have an alternative route to market. Specialist sites will enable buyers and sellers to assess risks more accurately. Apps and sites are springing up that will let them confirm each other’s identities and swap verified results from sexual-health tests. Schemes such as Britain’s Ugly Mugs allow prostitutes to circulate online details of clients to avoid.

Governments should seize the moment to rethink their policies. Prohibition, whether partial or total, has been a predictable dud. It has singularly failed to stamp out the sex trade. Although prostitution is illegal everywhere in America except Nevada, old figures put its value at $14 billion annually nationwide; surely an underestimate. More recent calculations in Britain, where prostitution is legal but pimping and brothels are not, suggest that including it would boost GDP figures by at least £5.3 billion ($8.9 billion). And prohibition has ugly results. Violence against prostitutes goes unpunished because victims who live on society’s margins are unlikely to seek justice, or to get it. The problem of sex tourism plagues countries, like the Netherlands and Germany, where the legal part of the industry is both tightly circumscribed and highly visible.

The failure of prohibition is pushing governments across the rich world to try a new tack: criminalising the purchase of sex instead of its sale. Sweden was first, in 1999, followed by Norway, Iceland and France; Canada is rewriting its laws along similar lines. The European Parliament wants the “Swedish model” to be adopted right across the EU. Campaigners in America are calling for the same approach.

Sex sells, and always will

This new consensus is misguided, as a matter of both principle and practice. Banning the purchase of sex is as illiberal as banning its sale. Criminalisation of clients perpetuates the idea of all prostitutes as victims forced into the trade. Some certainly are—by violent partners, people-traffickers or drug addiction. But there are already harsh laws against assault and trafficking. Addicts need treatment, not a jail sentence for their clients.

Sweden’s avowed aim is to wipe out prostitution by eliminating demand. But the sex trade will always exist—and the new approach has done nothing to cut the harms associated with it. Street prostitution declined after the law was introduced but soon increased again. Prostitutes’ understandable desire not to see clients arrested means they strike deals faster and do less risk assessment. Canada’s planned laws would make not only the purchase of sex illegal, but its advertisement, too. That will slow down the development of review sites and identity- and health-verification apps.

The prospect of being pressed to mend their ways makes prostitutes less willing to seek care from health or social services. Men who risk arrest will not tell the police about women they fear were coerced into prostitution. When Rhode Island unintentionally decriminalised indoor prostitution between 2003 and 2009 the state saw a steep decline in reported rapes and cases of gonorrhoea*.

Prostitution is moving online whether governments like it or not. If they try to get in the way of the shift they will do harm. Indeed, the unrealistic goal of ending the sex trade distracts the authorities from the genuine horrors of modern-day slavery (which many activists conflate with illegal immigration for the aim of selling sex) and child prostitution (better described as money changing hands to facilitate the rape of a child). Governments should focus on deterring and punishing such crimes—and leave consenting adults who wish to buy and sell sex to do so safely and privately online.