Casino revenue fell significantly last year in Pennsylvania and New Jersey, not a surprise considering the prolonged closure of gaming properties due to the pandemic. But the impact on tax revenues in the two states could not be more different.

In Pennsylvania, state and local government collected $317 million less in tax revenue from gambling, down 22%, according to data released Tuesday by the state. But in New Jersey state tax revenue actually increased slightly over 2019, even though total gaming revenue was down 17% due to casino closures.

New Jersey’s total tax revenue, $302.7 million, was up about $2.3 million over the previous year thanks largely to a huge shift of gaming to online platforms. New Jersey taxes internet bets at a higher rate than bets wagered in a casino.

In New Jersey, where online casino and poker games launched in 2013 and online sports betting in 2018, wagering on the internet largely kept the state treasury whole. In Pennsylvania, online gaming started more recently, and largely saved the gaming industry from bigger losses.

“Without the increase in online revenue, there is no telling how much weaker a position the entire industry would be in right now,” Dustin Gouker, lead analyst for PlayPennsylvania.com, said in a statement Tuesday.

Legal gambling operators in Pennsylvania collected about $2.7 billion in winnings from bettors last year, down from $3.4 billion in 2019, according to the Pennsylvania Gaming Control Board. In New Jersey, revenue totaled $2.9 billion last year, compared to $3.5 billion the previous year, according to the New Jersey Division of Gaming Enforcement.

Though the two states reported comparable winnings from casinos and online gaming platforms, Pennsylvania generates far more tax revenue from the industry because of its higher tax rates. Pennsylvania, which collected $1.1 billion in taxes last year compared to $1.4 billion in 2019, assesses a tax rate on slot machines at most casinos at about 52%, which includes 34% state tax, 2% local share assessment, 6% for the Economic Development Trust Fund, and about 10% for the Pennsylvania Race Horse Development Fund.

New Jersey taxes revenue from casino table games and slots at 8%, but internet games at 15%. So even though revenue from Atlantic City casino games declined by $1.2 billion last year, or 44%, internet gaming revenue doubled to $970 million, and generated more tax revenue for the state than casino games. The net result for the state treasury in Trenton was no change in tax revenue.

The 12 Pennsylvania casinos were closed about a third of the year to comply with lockdown restrictions, and suffered from lower traffic when they reopened. Slot machine revenue, the big money-earner, was off 43% last year and table games revenue was down 44%.

Rivers Casino Philadelphia was closed for 165 days last year, the longest outage of any of the state’s casinos because Philadelphia imposed a stricter lockdown on businesses during the pandemic. Its slot machine revenue was down 55% and table games revenue was down 49% last year.