New York City’s airports are rock-bottom when it comes to getting to them by subway, bus and rails, according to a new analysis.

Even though New York is supposed to be a transit-friendly city, its metro airports were socked in the Global Gateway Alliance survey by cities like Atlanta and Phoenix.

The 30 busiest airports around the globe and their mass-transit options were looked at by the airport advocacy group.

JFK tied with Denver’s airport for last place due to the 47-minute trip it takes from Penn Station to get there via the LIRR and Air Train.

LaGuardia and Newark came in second-to-last, tying with airports in Jakarta and Istanbul.

LaGuardia recently added the Q70 limited service to connect it with subway riders in Woodside and Jackson Heights.

Spain’s Madrid-Barajas International Airport and the Netherlands’ Amsterdam Airport Schiphol were at the top of the pack.

Madrid’s city center was a 16-minute trip from the airport, and Amsterdam’s was 16 minutes and 30 seconds.

“The billions being invested in modernizing our airports simply won’t pay off without 21st-century transit access to move passengers to and from these hubs, and that ultimately means a one-seat ride,” said Joe Sitt of the Global Gateway Alliance.

Gov. Andrew Cuomo proposed last month an Air Train to LaGuardia last month, which would connect it with the crowded 7 train in Queens.

Officials had eyed connecting the airport with the N train in the past.

Vice President Joe Biden said in 2014 that LaGuardia was comparable to “some Third World country.”