S UGAR TAXES are on a high. Around 40 countries and seven American cities have started to tax sugary drinks, mostly in the past few years. Supporters say such levies compensate for the costs imposed on health services by higher rates of obesity, diabetes and heart disease. They might also help short-termist buyers avoid the long-term consequences of sugary indulgences. Opponents counter that such levies are a fun-killer, souring people’s pleasure, and regressive, because poorer people spend a bigger share of their incomes on soft drinks.

Two working papers published on May 20th seek to help policymakers find the sweet spot. Hunt Allcott of New York University, Benjamin Lockwood of the University of Pennsylvania and Dmitry Taubinsky of the University of California, Berkeley, compute the “optimal” tax rate that maximises social well-being, taking into account differences in consumers’ income and behavioural biases.

Consumer data show that a soda tax does indeed have regressive effects. American households earning less than $10,000 a year buy twice as much sugary drink as those earning $100,000. Weighed against that, the gap between desired and actual consumption is wider for poorer people than it is for richer ones. The authors surveyed households to gauge their knowledge of sweet drinks’ nutritional content and how much their consumption outstrips what they regard as ideal. The average household, they conclude, would consume a third less if it had expert nutritional knowledge and perfect self-control. That rises to a half for poorer households.

One of the main determinants of the optimal tax rate turns out to be the price elasticity of demand for sugary drinks. If demand is sensitive to changes in price, then a tax will change behaviour, benefiting poorer people’s health and aligning their behaviour more closely with what they say they desire. Those gains would offset the regressive effects. But if consumers really have a sweet tooth—that is, demand is price-inelastic—then the regressivity effects dominate and a sugar subsidy would actually help redistribute income from the rich to the poor.

By analysing shoppers’ behaviour, the authors find that demand is elastic enough that a tax, and not a subsidy, is socially beneficial. They compute an optimal tax rate of 1-2 cents per ounce of soft drink in America. That is higher than the average rate of 1 cent in those cities with a tax.

But there is a wrinkle. In the real world, if taxes in one place get too high shoppers will arbitrage the rules by travelling to buy soft drinks elsewhere. Taking this into account they reckon that the optimal rate for cities is 0.5 cents, although a more efficient system would be a state or national tax to control America’s sugar rush.