The city has been changing “hundreds of thousands” of parking tickets online in an unfair — and possibly illegal — attempt to fix flawed summonses before they are dismissed in court, a driver advocate charges.

Tickets that are incorrectly filled out by the issuing police officer or traffic agent — such as omissions or inaccuracies in describing the car, the location or even the cop’s name — can be thrown out by a judge.

But now the tickets that drivers find on their windshields don’t always match the online version they find uploaded to the city’s Department of Finance website, where a driver goes to fight or pay a ticket.

Some handwritten tickets with obvious errors have been repaired weeks later in the online version.

Changing a ticket after the fact is a no-no, according to watchdog Glen Bolofsky, president of ParkingTicket.com, which helps motorists fight violations . He claims his auditors found some 220,000 “altered” tickets dating back to 2014.

“When there’s more than one version of the ticket containing different information, the ticket is illegal,” Bolofsky told The Post. “When you get a parking ticket, you have one shot to bring on your best possible defense. The city also gets one shot to write the ticket. By altering the tickets, they are getting an unfair advantage.”

Richard Brienza, who has a fleet of delivery vans and trucks, said one of his drivers received a $115 ticket for “no standing” in front of 165 W. 48th St. However, the ticket didn’t include the time or date of the offense. Several weeks later, when the summons was uploaded to the city website, the NYPD-issued ticket read that the violation occurred on May 24 at 9:50 a.m.

“I think they wrote the ticket, left off information and caught their mistake later on,” Brienza said.

Bridget McNally of the Bronx, whose husband Daniel owns a plumbing company, said one of his truckers received a $115 ticket May 28 for double parking in front of 364 W. 127th St. The make of the vehicle and name of the law enforcer were left blank on the summons — but that information was added online weeks later.

McNally suspects the mistakes are made in a rush to fill ticket “quotas” — and city coffers.

“Just like they make us do everything properly, they have to do the same. Fill out the paper properly,” she seethed.

Bolofsky — who is poised to sue the city over the changed tickets — estimated the city has made $21 million off drivers by avoiding the dismissal of 220,000 flawed parking tickets.

Most of those drivers will never know they could have won their case in court — “and the city will never tell them,” he said.

“We check the ticket online — and as per the examples we have provided, along with thousands of others — the ticket published online contradicts the ticket on the street,” Bolofsky said, adding that he has two sets of auditors review tickets before taking the fight to the Parking Violations Bureau.

The NYPD referred The Post to the Department of Finance.

“The city does not illegally alter parking tickets it gets from agents in the field,” said Craig Cine, an agency spokesman.

He said the city issued over 11 million tickets last year and “there is no evidence this is a widespread issue. We take each individual case seriously and New Yorkers can always appeal tickets at DOF if there is any missing information on their ticket.”