Jeff Bezos April Greer | The Washington Post | Getty Images

Online retailers saw their shares slide on Thursday following the Supreme Court's decision to allow states to collect more sales tax from e-commerce companies. But Amazon, the largest online retailer that's become nearly synonymous with e-commerce, stands to benefit from the court ruling, law experts say. "Amazon should be helped because it is collecting sales tax in every state, while it is the Wayfairs of the world who are directly hurt," John Swain, a law professor at the University of Arizona, told CNBC. Thursday's Supreme Court decision overturned a ruling from 1992 that allowed online retailers to skirt sales tax collection responsibilities in states where they don't have a physical presence. Since Amazon already collects sales tax in every state on the products it sells directly, which account for roughly half of all units sold on its site, the court ruling should have less impact on how much it charges for its products. The other half of products on Amazon are sold by third-party merchants on Amazon's marketplace. They potentially face the added burden of collecting sales tax in states that begin taxing online sales.

Most of Amazon's competitors, like Wayfair or Overstock, are in a more difficult position because they haven't been as rigorous or complete about collecting sales tax in states they don't have a physical presence. Now that they could have to collect tax throughout much of the U.S., beating Amazon on price will become even harder. Amazon shares were down less than 1 percent Thursday. Overstock, however, saw its shares drop over 6 percent, while Wayfair shares dropped by roughly 8 percent before recovering. "We see limited impact on Amazon," Colin Sebastian, an analyst at Baird Equity Research, wrote in a note published Thursday, adding medium-sized merchants that do not already collect sales tax in most U.S. jurisdictions will be most exposed to the ruling. The more important question for Amazon is how Thursday's decision will change the way its third-party sellers, who have become a rapidly growing piece of the business, collect sales tax. Paul Rafelson, a law professor at Pace University, says the Supreme Court decision doesn't really address this issue, "punting" most of the questions related to marketplace sellers. In the marketplace, Amazon facilitates the sales of third-party merchant products, so it's unclear whether Amazon or the third-party seller should be responsible for collecting tax. "Amazon can hide behind its marketplace to claim tax exemption because it's still going to pretend it's not a retailer — and not responsible for collecting sales taxes," Rafelson said. "There's still a lot of legal questions that need to be answered."

Up to the states

An Amazon spokesperson said in a statement that the company isn't commenting on the ruling. Some states, like Washington, Pennsylvania, and Minnesota, now require Amazon and other online marketplaces to collect sales tax on behalf of their third-party sellers. Others make it the seller's responsibility. But because of the new Supreme Court decision, states may decide to go after individual sellers, freeing Amazon from the complicated tax collection process in different states, said Matt Boch, an attorney from law firm Dover Dixon Horne. "The [ruling] may slow the adoption of these marketplace collection laws and instead leave states going after the platform sellers directly under an economic nexus approach," Boch said. Rafelson said the best solution would be for Congress to take action and come up with a standardized approach on how to tax online sellers. Under the current law, each state has different requirements and policies, making it difficult to charge sales tax. "There's no commonality in the way the state do it," he said. "Congress needs to standardize this stuff because otherwise, it gets out of control."

WATCH: Date for Amazon Prime day may have been leaked