Glenn Hegar had some good news to share earlier this month. Texas faces a shortfall of nearly $1 billion -- not great, but a lot healthier than the $4.6-billion budget hole the state's comptroller projected back in July.

One big reason for the relative recovery, Hegar says, is online sales taxes. By July, collections from remote and online retailers were higher than they’d been during the previous holiday shopping season.

“Online sales taxes have been a critical source of revenue that has helped state and local governments in Texas weather this pandemic,” says Hegar.

Texas is not unique. In at least one way, the pandemic was well-timed for state and local governments. After years of trying, they got the Supreme Court to agree in 2018 to allow collection of taxes on sales by vendors who don’t have a physical presence in their states. A year earlier, Amazon, the largest online retailer, had agreed to collect sales taxes in all 45 states that impose such taxes.

In other words, the pandemic, bad as it has been, would have been worse financially for state and local governments if it had struck in 2015, rather than in 2020.

“We’ve talked to a lot of cities who said this was a key element that helped them keep going in this crisis,” says Michael Gleeson, legislative manager for finance at the National League of Cities. “There would be a much bigger loss of revenues for cities, and there would be a much bigger hole that cities would be facing right now, if revenues had not been picked up while everyone was shopping online.”

Online retail sales topped $200 billion in both the second and third quarter of last year. They peaked as a share of total retail at 16.1 percent during the second quarter (April through June, when many states had imposed stay-at-home orders), according to the U.S. Census Bureau. Their share dipped in the third quarter to 13.5 percent of total sales – but that still represented a jump of nearly 40 percent, compared to the same period in 2019.

That’s real money. Cities and states still mourn the hit that stores on Main Street and shopping malls have taken, but at least they were able to capture a substantial share of the purchases that shifted online.

“That revenue was not only helpful, but in some ways it’s become almost essential,” says Patrick Murphy, vice president of public finance at Arnold Ventures, a philanthropic foundation. “Purchases at brick-and-mortar stores going down is bad enough, but if they hadn’t been able to capture some of the money online, what a problem that would have been.”

States Were Ready to Act

The 2018 Supreme Court decision, in South Dakota v. Wayfair, overturned prior decisions that had made it impossible for states to collect sales taxes from remote sellers. They certainly tried in different ways, but were shot down by various courts. It was the long-sought Wayfair decision, as it’s known, that opened the door for states to collect taxes on most online sales.

“Prior to the Wayfair decision, although some ecommerce sellers were going down the path of starting to collect sales tax on their sales, online sales was still a potential avenue to avoid the sales tax,” says Chuck Maniace, vice president of regulatory analysis at Sovos, a tax compliance firm.

Wayfair allows states to demand that businesses without a physical presence collect and remit taxes, assuming they make at least $100,000 worth of in-state sales. Following the decision, large states such as California and Texas have set the threshold higher, at $500,000. States differ in terms of how many in-state transactions can take place before a seller has to collect taxes (generally, about 200).

States had been laying the groundwork for collecting taxes on online sales for many years. Since 2000, a consortium called the Streamlined Sales Tax Governing Board has worked on ways to make tax systems more uniform. Half the states have adopted its system of definitions, rules and exemptions.

That was key, since figuring out sales tax codes even in individual states can be a chore. A state might exempt raisins and yogurt while taxing yogurt-covered raisins because they're considered candy, for example. Wisconsin devotes five pages of its tax code to questions about taxing ice.

“For some reason, clay pigeons are tax-exempt,” says John Macco, who chairs the Ways and Means Committee in the Wisconsin Assembly. “I didn’t know we had a clay pigeon lobby.”

Having pushed the question all the way to the Supreme Court, states were ready to act once they had the green light. Forty-three of the 45 states that collect sales taxes had implementing legislation in place in time for the pandemic.

“Addressing the issues raised as a result of the Wayfair decision … ensured that my agency was prepared when collections began to increase sharply in April 2020,” says Hegar, the Texas comptroller, who notes that the state collected $1.3 billion from online sales in the first year after implementing Wayfair. “For the most part, this revenue would not have been collected but for marketplace legislation and the requirement that certain remote sellers collect taxes on sales.”

Who’s Still Missing Out

The two sales-tax states without Wayfair legislation on the books are Florida and Missouri. In Florida, extending the sales tax to online commerce sounded like a new tax, making it politically tricky. In Missouri, the question was how to untangle the complicated local and state sales and use tax system.

“It actually came up on the Senate floor the day we broke for COVID-19,” Missouri Sen. Andrew Koenig told The Missouri Times. “When we came back to session, we just didn’t have the time to work out a compromise on it.”

Lawmakers in both states are expected to make another run at the issue this year. The pandemic, with all its disruptions to in-person transactions, has proven to be no time for failure in taxing online purchases.

“Bills have been filed in both chambers and we’re already hearing bipartisan support for the measure,” says Scott Shalley, president of the Florida Retail Federation. “It has been a years-long effort in Florida to fix the glitch in state statute to remove the burden from the consumer and ensure that Florida retailers are competing on a level playing field.”

Other states are still tinkering with their rules. Under Wayfair, states can’t impose requirements that present an “undue burden” to online sellers. There are differences of opinion about whether retailers should have to collect sales taxes for every locality that imposes its own rates above and beyond what a state may charge.

In Texas, retailers can ask to be part of a simplified program that exempts them from collecting or tracking all the local rates, instead working with one rate statewide. Still, modern software means that if retailers can figure out where to ship a package, they can figure out the local sales tax.

“We ended up just exceeding our sales tax estimate for the year,” says John Bruggen, assistant budget and finance administrator for Hamilton County, Ohio. “We ended up hitting budget on the sales tax, which is our major revenue source.”

For most states, cities and counties, being able to collect taxes on online sales has proven to be a boon at a time of continuing financial troubles.

“It did come at a good time for them,” says David Hitchcock, a senior director at S&P Global, a financial ratings firm. “With revenues down, they need every dollar they can get.”