In Stockholm, the homeless now accept credit cards. Sweden's high-tech economy has made bills and coins almost obsolete, so equipping the destitute with card readers — a world first, apparently — was a natural evolution.

It's a tidily Nordic expression of a global trend. This is the age of credit cards and debit cards, of PayPal, Square and Amazon Coins. In some places — parts of Africa, for example, where people can use their mobile phones to buy everything from dinner to insurance — the need for cash for legitimate purposes has all but disappeared.

Governments the world over may be tempted to speed this transition to a cashless society. And they could do so pretty easily, first by accepting digital payments for taxes and public services, then by gradually winding down their mints and printing presses. But while they're right to encourage people — especially the poor — to take advantage of digital payment methods, governments also should prepare for the risks involved. Cash has some virtues that whatever replaces it should strive to match.

The disadvantages of cash won't be missed — and there are plenty of them. It's vulnerable to theft and loss. It's difficult to move around in large quantities. It's ideal for anyone who wants to launder money or evade taxes.

All this means that cash costs money: A study published last month by Tufts University estimates that handling hard currency costs U.S. businesses $55 billion annually in theft, security expenses and additional labor. For consumers — who pay nearly $8 billion each year in automated teller machine fees and spend an average of 28 minutes a month traveling to access money — cash imposes costs of about $43 billion a year. Lost tax revenue from unreported cash transactions adds up to at least $100 billion annually.

Digital money could make it easier for central banks to do their job, because in a cashless world, they could fight recessions and deflation by driving interest rates to less than zero. This is a big deal. Cash creates what economists call the zero lower bound. Who'd accept negative interest rates when you can hold cash instead? Cashlessness does away with it: Standard monetary policy, based on lowering interest rates as needed, wouldn't have to stop when rates hit zero, so there'd be no need for quantitative easing and other questionable innovations.

And then there are the societal benefits. Most important, moving away from cash could ease access to the financial system for the world's poor and "unbanked," who pay the most to access money (think payday lending and check-cashing fees) and, in effect, transfer some of their income to better-off households that use credit cards. Getting these folks to use digital-payment systems would be an excellent first step toward getting them into the banking system, making it easier for them to get loans and save money.

So what's not to like? For all its benefits, a cashless society is also one brimming with potential problems. Some are familiar to anyone with a credit or debit card: transaction fees, overdrafts, usury, identity theft, piratical hackers and old-fashioned fraud. Others are new: Many novel payment systems aren't compatible with one another and have uncertain life spans, for instance.

The age of credit cards is also the age of behavioral economics, a discipline that advises caution. When you spend cash (to simplify a bit), pain receptors in your brain activate and discourage you from overindulging. Credit cards don't have the same effect. People will pay more for the same item using credit cards. They rationalize dishonesty more easily. Not to be overly alarmist, but they also buy more junk food.

To some extent, technology can help. Mobile-phone applications are already available to help people balance budgets or alert them when they exceed a daily spending threshold. Visual cues that replicate the ordeal of parting with cash might also help. Still, there's every reason to think that indebtedness will increase as cash use dwindles.

Another concern is privacy. In a cashless society, everything you buy could be on a permanent record, ready to be collated by marketers, hacked by criminals or monitored by an increasingly invasive government. You don't have to be a criminal to be uncomfortable with such an arrangement. The growing popularity of "cryptocurrencies" such as Bitcoin and the enduring demand for $100 bills testifies to how powerful the impulse is to protect one's financial privacy.

One potential solution for central banks to consider is to offer a digital legal tender of their own. Such a currency could, in theory, offer the benefits of cashlessness yet maintain the legitimacy of a nationally backed tender.

Despite the problems a cashless society presents, its economic logic and potential to help the poor seem irresistible. It will exact a heavy toll, no doubt, of unintended consequences. Technological advancement demands its due — but it helps if you don't need cash to pay it.