“Viral food” sounds like the very thing that most chefs would want to avoid. But when food goes internet-viral, it usually translates to fame and fortune for the creator and a tasty payoff for the rest of us.

Oddball vittles such as Cronuts, Ramen Burgers and Rainbow Bagels all busted out big-time as one foodie picked up on it from another, curiosity grew exponentially and the popularity invariably took everyone by surprise.

Such was the case at 16-seat Black Tap, home of the biggest viral-food breakout in recent memory.

Owner Joe Isidori kicked things off innocuously: He made ornate milkshakes to amuse his wife. Then iPhone-toting customers became intrigued, and the internet did the rest.

“I remember coming to work one day, seeing a line and wondering what was happening,” says assistant general manager Peter Caporal. “It was a jolt and a lot of fun — especially having customers from other countries who found us online. Even now, we still get people wondering about the line. Sometimes they think we’re giving away free burgers.”

Here, we track the boom and bust cycles of eight food fads that took New York City by storm.

Dominique Ansel Bakery Cronut

The Cronut — essentially a doughnut made with laminated croissant dough — went viral on Day 1, thanks to a GrubStreet.com posting that generated 140,000 links (189 Spring St.; 212-219-2773; dominiqueansel.com/).

Peak popularity: Spring and summer of 2013, when three-hour waits became the norm and more than 200 people would line up before the shop opened. Scalpers charged $3,000 for 10 Cronuts. Ansel hired security.

The aftertaste: Ansel opened Cronut-centric bakeries in London and Tokyo, turning down opportunities across Europe, South America and Asia. He also opened a second bakery in Manhattan, but it does not sell Cronuts. “People told me to open factories in New Jersey and distribute all over the world,” says Ansel. “I’d rather push myself and keep moving forward in more innovative ways.”

STILL HOT: As the New York shop’s 8 a.m. opening approaches, lines can still be 100 people strong. Only 350 Cronuts are made each day in New York, and they tend to be gone by noon.

Black Tap milkshake

Front-page notice on Buzzfeed led to an immediate blowup of these elaborate shakes adorned with M&Ms, chocolate-covered pretzels, slices of cake and the like (529 Broome St.; 917-639-3089; blacktapnyc.com/).

Peak popularity: From November 2015 until July 2016, six-hour waits were not unusual. Customers ordered pizza from nearby Rossetti’s and ate one meal while waiting on line for another.

The aftertaste: This past July, chef-owner Joe Isidori opened a downstairs annex and added 55 seats. He’s also launched a Meatpacking branch, and later this month, he’ll open a Midtown outpost on West 57th Street. A cookbook, “Craft Burgers & Crazy Shakes From Black Tap,” was published Nov. 1.

STILL HOT: New Yorkers as well as tourists brave 90-minute waits. “I heard about it from a friend,” says Joan S., a 30-year-old teacher from the Bronx who declined to give her last name for professional reasons. “I’d rather not wait in line, but I guess this is part of the experience.” Show up at 3:30 on a weekday afternoon and you might be able to stroll in.

The Bagel Store Rainbow Bagel

Though these slightly sweet, clownish-looking bagels were sold at the Bagel Store since the mid-1990s, it took a video on BusinessInsider.com for them to blow up and generate two-hour waits (74 Metropolitan Ave., Brooklyn; 718-782-5856; thebagelstoreonline.com).

Peak popularity: February and March 2016, when rainbow-bagel inventor Scot Rossillo kept crowds cool by sending out samples of other innovations — such as his croissant bagel. Demand got so intense that one of two stores temporarily closed in order to keep things manageable. TV coverage included “Super Bowl Live With Bryant Gumbel.”

The aftertaste: Things simmered down by this past April. But, at that point, rainbow bagels had permeated the mainstream with knockoffs all over town. Nevertheless, corporate clients such as JetBlue, Google and the Islanders went to the original for bagels in their company colors.

FIZZLED: On weekends there are normal, popular bagel-store lines. You can be in and out within 15 minutes.

Magnolia Bakery’s Carrie cupcake

Magnolia mania kicked off when a 30-second bit on “Sex and the City” depicted Carrie Bradshaw eating a vanilla cupcake with pink frosting and topped with a sugar-candy daisy (401 Bleecker St.; 212-462-2572; magnoliabakery.com).

Peak popularity: In the summer of 2000, lines stretched around the corner, though waits rarely exceeded 45 minutes. A so-called “cupcake bouncer” was employed. Lou Reed walked in and stormed out after an employee put a song of his on the sound system.

The aftertaste: Today, there are six branches in Manhattan and 22 more around the world. An additional cupcake appearance in the 2005 “SNL” digital short “Lazy Sunday” led to a bump in business. Plus, “Sex and the City” tour buses still stop there regularly.

FIZZLED: Often, you can walk right in and order a cupcake. If you run into a tour bus or hit the place on a Saturday night in the summer, you might be lining up for 10 minutes.

Brodo broth

This bone broth, served in a paper cup and made from chicken, beef and turkey, coincided with a bone-broth health craze endorsed by Gwyneth Paltrow (200 First Ave.; Brodo.com).

Peak popularity: January through March 2015, lines of 40 people waited 20 minutes or so at the Brodo window, adjacent to Hearth restaurant in the East Village. A “Good Morning America” reporter asked if Brodo is “truly a magical elixir.” Tom Colicchio, former boss of Brodo creator Marco Canora, touted Brodo on the “Today” show.

The aftertaste: “Brodo: A Bone Broth Cookbook” was published last December. A pop-up at the Bryant Park ice rink will be open until January, and Canora just launched Brodo Broth Shop in the West Village (496 Hudson St.; 212-366-0600), which serves cups of broth that can be topped with frothy emulsified fats (butter, beef marrow and coconut oil).

HANGIN’ ON: With the weather still mild, lines are minimal. By winter, Canora expects to have 10 or 15 people waiting at any given time.

Levain Bakery chocolate chip and walnut cookie

Food Network coverage put the spotlight on these cookies, which are crisp on the outside, rich and pillowy on the inside (167 W. 74th St.; 212-874-6413; levainbakery.com).

Peak popularity: In the mid-aughts, lines stretched halfway across West 74th Street, and waits ran to 45 minutes. It got long enough that hungry, time-crunched customers paid surrogates to wait on line.

The aftertaste: Cookbook offers rolled in and were rejected. “The recipe is a secret, and we want to keep it that way,” says co-owner Connie McDonald. She and her partner appeared on “Throwdown With Bobby Flay” — and won the cookie bake-off. There are currently three Levain shops, and a fourth is coming to the Upper West Side.

HANGIN’ ON: On a recent Sunday, it took about 10 minutes to get a cookie. But there are times when lines still stretch down the block and waits can run 30 minutes. (The bakery has streamlined its serving process.) Retired Argentine transplant Alberto Oliver, 74, admits to having logged 30 minutes for a cookie — “It’s worth the wait!,” he says.

Superiority burger

This particularly juicy and meat-like veggie burger topped with cheese got love from David Chang’s Instagram feed, and Questlove had chef Brooks Headley cook them at a “salon” he hosted.

Peak popularity: In the summer of 2014, when it operated as a roving downtown pop-up, the burgers would sell out in less than three hours.

The aftertaste: In June 2015, Superiority Burger opened in a permanent East Village location (430 E. Ninth St.; 212-256-1192; superiorityburger.com). Lines stretched to Tompkins Square Park — but they never equaled those of the pop-ups. Since the restaurant is tiny, people tend to get their veggie delights to go and sit on nearby benches to eat. Sick of the al fresco interlopers, locals affixed stones to benches as deterrents. In October 2015, GQ named Superiority the best burger of the year.

HANGIN’ ON: We rarely see lines extending beyond the door, though the sidewalk is often littered with people waiting on their orders.

Ramen Burger

Creator Keizo Shimamoto Instagrammed photos of his Ramen Burger — a cheeseburger between buns made from al dente ramen noodles and topped with miso-based sauce — and watched it go viral before its debut.

Peak popularity: August 2013, when the burger showed up at Smorgasburg and more than 150 people lined up. Soon after, people started arriving at 5 a.m. in order to guarantee getting one of the 300 Ramen Burgers produced each weekend. “A girl tried jumping the line by offering to trade me a Cronut for a Ramen Burger,” remembers Shimamoto. “It worked.”

The aftertaste: Countless copycats materialized, but, says Shimamoto, “none of them knew my secret.” He has since opened a brick-and-mortar shop in Long Island City (13-13 40th Ave.; 929-522-0285), in addition to his Smorgasburg stand (1 Hanson Place, Fort Greene; BrooklynFlea.com).

HANGIN’ ON: There was no line at this past Sunday’s Smorgasburg, although the outdoor summer version of the food festival still draws crowds. Taking a first bite, Thomas Dargan, a 35-year-old Brooklyn-based IT worker, says, “The flavors are intense, but I would not wait a half-hour for it.”