The Supreme Court is considering a case that could force consumers to start paying sales tax on all of their online purchases.

During arguments in South Dakota vs. Wayfair Tuesday, the justices debated whether online retailers must collect sales tax on purchases made even in states where they do not have a "physical presence," say in the form of an office, warehouse or distribution facility.

The answer to that question could carry a pretty hefty price tag.

Last year, states could have collected as much as $13.4 billion in additional online sales taxes, according to the General Accountability Office. That revenue source is becoming increasingly critical to state governments as citizens do more of their shopping over the internet — it's only 9% of all retail sales currently, but growing steadily.

Many of the largest online retailers, such as Amazon, already pay sales taxes because they have enough of a physical presence in most states through their network of warehouses and distribution facilities.

But plenty of smaller players, such as home furnishings websites Overstock.com and Wayfair, don't have widespread enough operations to be subject to the tax law, giving them a substantial price advantage over traditional brick and mortar businesses.

Related: For gig economy workers in these states, rights are at risk

Several justices worried that allowing states to reach outside their borders to collect sales taxes could create messy legal questions and endless litigation. Justice Sonia Sotomayor broke in first, asking why states couldn't just make their own citizens pony up rather than get into the constitutional problem of interfering with interstate commerce.

"It's not the merchants that pay the tax, it's the consumer," Sotomayor told Marty Jackley, the attorney general of South Dakota. "So, find a way to collect from them."

Most states have had little success doing so, given the difficulty of tracking information about who has bought what, as Justice Ruth Bader Ginsburg pointed out later in the argument.

"In the real world, it's much more likely to yield funds if you go after the seller than if you go after the consumer," Ginsburg said.

Justices were also concerned about the possibility that remitting sales taxes to approximately 12,000 jurisdictions at different rates on innumerable products would be prohibitively expensive, allowing already dominant companies to squelch competition from smaller firms or startups.

"The hope of preventing oligopoly is small business," said Justice Stephen Breyer, who repeatedly asked for clarity on what it would cost to comply with so many different laws.

Related: As economy heats up, job sites compete to find candidates

Answers in filed briefs ranged from $12 for 30 transactions to $250,000 for an entire software system, although the Software & Information Industry Association argued that costs could come down dramatically with the demand that would be generated by a change in the law.

Other justices pointed out that the concern should not be for the internet startups, but rather for the small brick-and-mortar retailers that are being squeezed by online competitors that offer products free of sales tax. On this point, Ginsburg and Justice Neil Gorsuch agreed that requiring sales tax collection of everyone would level the playing field, not tilt it.

"Why should this court favor a particular business model?" Gorsuch asked the lawyer for the online retailers, George Isaacson.

The final major disagreement centered on whether the court should back off and let Congress fix the problem, even when it has taken no action since the last ruling on this question in 1992. Legislators would be better equipped than the judiciary to "craft a compromise," said Justice Elena Kagan.

A bill that would do what the states have been asking for has been introduced in the last several Congresses, but has not gotten a vote.