Master keys for every elevator in the city, major construction sites, subways and skyscrapers are being freely sold online, despite a city law that makes it illegal for unauthorized persons to possess them.

A New Jersey-based lock company is peddling an unlimited supply of New York City’s “1620” fire service keys on eBay at $15.50 for two.

Access to the Big Apple keys is sharply restricted. It’s unlawful for anyone other than firefighters, law-enforcement personnel, elevator contractors or inspectors and building owners to have them.

But a Post reporter bought two keys to the city with no questions asked from UltimateSecurityDevices.com, an online arm of Northeast Lock Corp. in Clifton, NJ.

The keys unlocked elevator control panels in a Midtown high-rise.

“It’s kind of scary,” said the building’s fire-safety director.

A veteran firefighter called the sale of a potential terrorist tool “disturbing.”

“That key gives access to elevator banks. Someone could take over the elevators in a high-rise building. In the wrong hands, you can see the problem,” he said.

The key could be used to trap people in a skyscraper by sending all the elevators to the lobby and out of service, experts say. It can also be used to control any individual elevator. Every elevator in the city is required to be fitted with a lock for the 1620 key.

Someone could take over the elevators in a high-rise building. In the wrong hands, you can see the problem - a veteran firefighter

In addition, the keys open lock boxes at construction sites and other buildings, leaving them open to theft, vandalism and sabotage. The lock boxes contain other keys to the site — such as ones to open gates and entrances — to give firefighters access in an emergency.

They also open subway entrance gates.

The FDNY issues 1620 keys to all firefighters. “If you lose it, there’s paperwork. It’s like losing your ID card — it’s a serious thing,” one said. “When you leave or retire, you hand it back in.”

UltimateSecurityDevices offers 1620 keys at $7.40 each for up to nine, and $6.66 each for 10 or more. Any order over $249 comes with a 10 percent discount.

A request for comment from City Hall was not answered.

The City Council amended local law in 2013 to make it illegal for unauthorized people to possess the 1620 or “citywide standard key.”

“If you’re selling it, it’s in your possession for an unlawful reason,” said City Councilmember Elizabeth Crowley, chairwoman of the Fire and Criminal Justice committee. “I can’t see a real locksmith [being] willing to jeopardize his career and the safety of others for a few bucks.”

Kevin McCallen, owner of Northeast Lock and UltimateSecurityDevices, did not return messages.