The Big Apple is hiding a colony of mad scientists furiously working on futuristic experiments that could one day offer you everything from odor-free socks to drug-detecting straws.

More and more scientific firms and projects are popping up around the city, thanks in part to a statewide program that gives such startups tax breaks, research experts say.

There’s a Brooklyn lab growing test-tube leather, a fruit farm now floating on the Hudson River, a chemist creating bacteria-free socks in Harlem and a Sunset Park team making date-rape drug-detecting straws.

Local universities are also upping the city’s scientific quotient by spending billions to build new tech and research centers, including one for New York University in downtown Brooklyn and Cornell’s soon-to-open technology hub on Roosevelt Island.

The bright ideas promise to improve health, agriculture and art across the globe — while providing fun for some of the scientists along the way.

“We’re a cross between [‘Ironman’ alter ego] Tony Stark’s lab and Willy Wonka’s chocolate factory,” quipped Annelie Koller, a senior design researcher at Modern Meadow, which is using living cells to grow leather.

“We’re doing something revolutionary.”

The floating farm

When the city told Mary Mattingly that she couldn’t grow fruit on public land, she got creative.

The 38-year-old Brooklynite designed a “food forest” with 80 species of plants that floats on the Hudson River.

The fascinating 130-by-40-foot contraption functions like a community garden on the go, complete with apple trees, raspberry bushes, asparagus and dozens of other fruits and veggies.

In warm-weather months, a tugboat hauls it to different spots around the city, including Governors Island, Brooklyn Bridge Park and Concrete Plant Park in the Bronx, where neighbors can hop aboard and nibble free food.

“We wanted to be provocative. There are things you can do on water that you can’t do on land,” said Mattingly, an artist who teamed up with scientists to launch the project last year. “You can turn the waterway into a common area with an edible landscape.”

The barge was constructed with shipping containers and is kept in storage in the winter. In the summer, it sucks up river water to hydrate plants through a special purifying system. It costs about $7,000 per month to dock and insure and was paid for with Kickstarter.com donations, Mattingly said.

“Not everybody has access to farmland. But I say the more green space the city has, the better. Even if it’s on the water,” she said.

The date-rape drug-detecting straw

Mike Abramson was celebrating a friend’s birthday at a bar in Boston when his first drink started feeling like his 15th. His friends got him home safely, but he soon learned he’d been drugged.

“You start to get really scared and it gets you thinking: How can I prevent this from happening?” he told NBC not long after the close call.

“I found testing strips for drinks, but they were kind of socially awkward. I couldn’t see myself using them on a date or in a bar. That’s when I had an ‘aha’ moment,” he said.

He teamed up with a chemist from Worcester Polytechnic Institute to make color-changing straws that detect “date rape” drugs, such as Rohypnol, ketamine and GHB.

He crowdsourced tens of thousands of dollars and moved his firm, DrinkSavvy, to Brooklyn BioBat’s “Incubator,” a sprawling Brooklyn Army Terminal building in Sunset Park.

The firm has since made prototypes of the clear straws, which are chemically engineered to turn red when they come into contact with a spiked drink. It has also produced early models of drug-detecting glassware in which red stripes appear on cups when a drink has been drugged.

“I’ve been getting interest from a lot of parents, bars and universities,” said Abramson.

Hundreds of thousands of people are drugged each year, he said. “It happens to men, too, whether it’s for robbing or kidnapping. This could help.”

Test-tube leather

Science is so in this season in Brooklyn, where a team of fashion-forward researchers is growing real leather without hurting animals or the environment.

The firm, Modern Meadow, uses the living cells of animals to “biofabricate” leather in a variety of never-before-seen textures. They use collagen, a protein found in animal skin, to grow hides, which are then tanned and finished.

“The fashion industry loves it because nobody wants to kill animals and you don’t need large farm lands, which give off carbon dioxide,” said Eva Cramer, president of BioBAT Inc.

Designers work with biologists to invent textures and thicknesses that don’t occur naturally, she said.

“If you want a leather blouse, you can make it thin and opaque. If you want something warmer, you can work with a thicker sheet that looks like wool and weave parts of it together,” she said.

The leather has yet to hit the market but the company, which has also grown in-vitro beef, has raked in a total $53 million in investment cash, said Natalia Krasnodebska, a rep for the firm.

Animal-experiment island

In July 2008, the corpse of a strange animal washed up on a Long Island beach. Residents named the creature — which looked like a cross between a dog and a turtle — the “Montauk Monster.”

Rumors swirled that it had escaped from Plum Island, a Central Park-size patch of land 100 miles east of the city, where the federal government has long conducted experiments on animals.

Legend has it, scientists on the island once Frankensteined a series of bizarre hybrid creatures — but the truth isn’t quite as horror-movie-worthy, said John Verrico, a rep for the Department of Homeland Security, which oversees the research.

“You have a government-owned lab that’s sequestered on an island that nobody’s allowed to go to. It’s ripe for conspiracy theories,” he said. “But, no, we didn’t make the Montauk Monster.

We don’t keep aliens there. Nothing we do is actually a secret,” he said.

Scientists there conduct livestock research to stay one step ahead of harmful pathogens that could damage the nation’s food supply, he said.

“Think of a cheeseburger. The thing that keeps cheeseburgers affordable, healthy and tasty is Plum Island,” he said. “It keeps them from costing, say, $100.”

In 2012, scientists on the island made a revolutionary vaccine for foot-and-mouth disease, which can wipe out entire herds of cattle, he said.

They also eradicated Rinderpest, a viral cattle disease, decades ago and have researched African Swine fever. The federal government now hopes to sell the island by 2022 in order to “modernize,” Verrico said.

Growing bones

War vets, people with disabilities and car-crash survivors — potentially anyone with a shattered bone — could benefit from these groundbreaking Brooklyn-based scientists.

EpiBone, a biotech firm, is the first company ever to grow living human bones from a person’s own cells.

“Let’s say you break your cheekbone, that it’s smashed to the point where it can’t be repaired. EpiBone uses your own stem cells to grow a replacement,” Cramer said.

Researchers take a sample of fat tissue from patients, along with a three-dimensional X-ray of the bone they want to engineer, then grow it on a scaffolding-like structure.

The firm’s CEO, Nina Tandon, 37, said it works better than a traditional procedure in which bones are removed from other parts of the body.

“It can cause problems because there’s no piece of bone that’s not necessary,” she told Scientific American.

“For example, my fiancé had surgery to reconstruct his ankle. They took a piece of his hipbone, and his abdomen now hurts as much as his ankle.”

The clone bones are better than synthetic implants, too, she said. “If you get injured at age 15 and you live to 115, the idea that your implant only lasts 10 to 15 years is becoming unsustainable.”

The firm has spent months on animal experiments and she hopes to begin human trials by 2018. If all goes well, it will hit the market by 2023.

“I love the idea that we can look at our own body as a source of healing, as opposed to pills and machines,” she said.

Bacteria-free socks

In a renovated Harlem building, scientists are toiling over a new way to keep germs from making your feet stink.

Tyler Poore, 31, who studied chemistry at Columbia University, and his firm Exsponge are developing antimicrobial polymers to keep socks free of bacteria, which can cause odor and fungus such as athlete’s foot.

The firm is housed in the Harlem Biospace building, which offers affordable lab space to budding scientists and startups. “If it weren’t for this space, we probably wouldn’t have started this company in New York City,” Poore, CEO of the firm, told DNAinfo.com.

He is also working to create antimicrobial polymers — bacteria-inhibiting molecules — that don’t add to the problem of bacterial drug resistance.