Diplomats and out-of-state drivers owe the city millions of dollars in unpaid parking tickets and fines — with the city not doing enough to collect the money, according to a new state audit.

The report from state Comptroller Tom DiNapoli found that 29,500 parking tickets haven’t been paid by out-of-staters, and since 2002, diplomats owe over $587,000.

“It’s simply unfair that so many New Yorkers face penalties and possible license suspension if they don’t pay parking tickets, while DOF [the city Department of Finance] does little if anything to pursue out of state drivers and diplomats’ cars,” DiNapoli said in a statement.

“They are writing off millions in potential revenue for the city,” he said.

The worst diplomatic offender is Italy, which owes $23,303. Nigeria is sticking the city with a $18,323 tab and $17,759 is owed by Indonesia, the audit found.

Officials from the DOF, which collects parking ticket payments, claimed the agency “cold-called” missions, consulates and the UN to recoup the penalties, but only recovered a measly $3,395 of the bill.

The agency also said they’ve ramped up their collection efforts.

“Our Collections Division has reached out to foreign missions and consulates for payments,” said DOF Deputy Commissioner Jeffery Shear.

“And the DOF Sheriff Office visits foreign missions and consulates after one of its vehicles is towed by the New York Police Department for committing a parking safety infraction and requests that payment is made.”

Car owners have 30 days to pay or challenge a written ticket.

If they don’t respond to a summons after 90 days, a default judgment is placed against the vehicle owner lasting up to eight years.

DiNapoli recommended the agency improve the way tickets are written and the way it collects payments.

Additional reporting by Kenneth Garger