The United Federation of Teachers is drafting plans to dramatically slash its $182 million budget — anticipating a Supreme Court ruling that would bar mandatory deduction of union dues from government workers’ paychecks to support union activities, The Post has learned.

The ruling could deliver a severe blow to union budgets by reducing membership and revenues by millions of dollars.

The 187,000-member UFT collects $56 twice monthly from each teacher’s paycheck via automatic payroll deductions.

If the Supreme Court rules against government employee unions, membership and dues revenues would likely plummet by 20 percent to 30 percent, labor sources said. The union would have to get written consent directly from teachers to collect dues from them.

“There’s concern some teachers would say no to paying union dues,” said a UFT insider briefed on the discussions. “How many people are disgusted with the union?”

UFT president Mike Mulgrew addressed top union officials at a retreat last week and repeatedly warned that “big change is coming.”

The belt-tightening may have already begun. The event was held at UFT headquarters at 52 Broadway instead of the Hilton Westchester in Rye, NY, where the union typically holds its retreats.

“Given the anti-union sentiment at the national level, the UFT is prepared to meet any challenges to its efforts on behalf of the membership,” a UFT spokesman said when asked about planned cutbacks.

The UFT is a massive, far-flung enterprise with a $42 million payroll that includes more than 700 members paid to perform full-time or part-time union duties.

The payroll includes borough reps, district reps and 65 staffers each making more than $150,000. Mulgrew pulls in $283,000.

The UFT empire includes offices in all five boroughs and the lease of a building in Delray Beach, Fla., to serve thousands of retirees in the Sunshine State.

The budget also includes millions of dollars in spending to law firms and media and political consultants to advance the union’s collective-bargaining strategy and broader agenda. Millions more are spent on catered events, conventions and donations to allied groups, including the NAACP, New York Communities for Change and The Black Institute.

Internal discussions include paring some of the borough staff and offices and curbing discretionary spending. Positions would be eliminated through attrition following retirements, sources said.

The UFT is not alone. All unions representing government workers are in the same predicament.

The Transport Workers Union — which represents 38,000 city transit workers who operate the subways and buses — knows it’s likely to lose easy access to dues collections.

The TWU’s right to automatic dues collections was revoked for 17 months as punishment for waging an illegal strike in 2015. The union had to collect the dues manually, and lost millions of dollars in revenue because many workers didn’t cough up the dough.

Supreme Court justices last year deadlocked 4-4 on a union-shop dues case called Friedrichs v. the California Teachers Association.

The court lacked a tie-breaking vote because of Justice Antonin Scalia’s death, but Justice Neil Gorsuch this year replaced Scalia.

A new case on union dues collection, Janus v. AFSCME, is expected to land soon on the Supreme Court docket.