The city is shifting its electric car readiness into high gear.

Mayor Bill de Blasio announced Wednesday a joint effort with Con Edison to invest $10 million in creating fast car charging hubs in each borough next year. The mayor said the stations, which can fully charge a car in 30 minutes, would incentivize motorists to choose environmentally friendly cars.

Flanked by cars from the municipal fleet being charged in a Whole Foods parking lot in Brooklyn, the mayor said he wants 20 percent of new car registrations to be electric cars by 2025.

“When we do something better, the earth feels it. It helps the earth,” the mayor said.

The locations — which the mayor said will not take up valuable parking spaces — will be determined by a number of factors including traffic, proximity to amenities and the number of electric vehicles located in the neighborhood. Each hub will have between 10 to 20 chargers and they will all be able to service 1,200 cars weekly, according to Mark Chambers, director of the Mayor’s Office of Sustainability.

The city will take input from the public on the initial hub locations, according to Chambers. By 2020, the city plans to have 50 charging hubs online.

“The goal is aiming to look at places where they can get the most use,” Chambers said.

The first five charging stations will cost about $10 million, according to de Blasio spokesman Seth Stein.

It will cost users 6 cents per mile to charge their vehicles, Stein said, compared to 10 cents per mile for traditional gas. A car driving 10,000 miles per year would save about $400, he said.

Existing hubs in the city can take as long as eight hours to charge a vehicle. The new hubs charge quicker because of higher-capacity electrical cable and newer batteries that can receive the additional load faster, according to Stein.

The announcement is part of the de Blasio administration’s goal to combat climate change, a move the mayor says is a necessary rejoinder to President Donald Trump’s promise to withdraw the United States from the Paris climate accord.

Last week, de Blasio said the city would force older buildings to outfit boilers, windows and heating/cooling systems to minimize pollution. He hopes to reduce the city’s greenhouse gas emissions 80 percent by 2050.