The city prosecuted almost 40 percent more rider complaints against yellow cabbies last year, The Post has learned.

Almost 7,700 drivers were given violations by Taxi and Limousine Commission prosecutors in 2013, up from 5,468 in 2012, according to TLC data.

Hacks shelled out almost $400,000 more in fines in 2013 than they did in 2012 due to the increase in prosecutions, although consumer complaints dropped by 12 percent in that same time period.

The TLC’s consumer complaint unit was bolstered in 2013 by a new digital system that went into effect that January.

The Electronic Summonsing and Adjudication Program digitized all of the prosecutors’ cases — leading to higher conviction rates as prosecutors were able to more easily manage their caseloads.

“So much of it was automated that our productivity went through the roof,” said Sherry Cohen, TLC assistant commissioner of prosecution. “It’s completely changed the way we do business.”

The digital system also helps the TLC with enforcement by giving cabbies summonses automatically if trip data and GPS show drivers breaking the law. It can even catch infractions such as driving with a suspended license.

Additionally, the consumer complaint unit was boosted by the partnership with the New York Law School, where second- and third-year law students work with the TLC at a law clinic to prosecute cabbies.

“It’s win-win,” Cohen said.

The law school added 13 clinics last year to give students practical experience by partnering with city agencies such as the TLC and the Department of Health.

Passengers who want to take action against a driver who breaks the rules can file a complaint through 311 over the phone or on its website.

Meanwhile, a new analysis by Pratt professor Ben Wellington released Friday shows that taxi riders called 311 and logged an average of 43 complaints per day — while drivers garnered an average of three compliments a day.

The data also shows that passengers were most likely to complain to the city during the taxi shift change at 4 p.m. — when it is difficult to get a cab unless your destination is on a driver’s way home.

Complainers took a break on Christmas, which saw the least number of 311 calls.

The party-friendly neighborhoods of Williamsburg, the East Village and the Lower East Side had the highest ratios of evening taxi complaints.

Wellington said he hopes the data on his blog I Quant New York will inspire more people to tell the city “about what is working and what isn’t.”