Where did fortune cookies come from—and how did they become so ubiquitous?

It’s customary in many restaurants for diners to receive a small treat with their check: mints, hard candy and sometimes even chocolate. But at many Chinese restaurants around the United States, patrons get something a little different: a Pac-Man-shaped, vanilla-flavored cookie containing a finger-sized slip of paper printed with a pithy fortune or aphorism.

While many Americans associate these fortune cookies with Chinese restaurants—and by extension, Chinese culture—they are actually more readily traceable to 19th-century Japan and 20th-century America.

From Kyoto to California

Fortune Cookie factory
Clem Albers/San Francisco Chronicle/Getty Images
Women working at the Lotus Chinese Fortune Cookie bakery in San Francisco, c. 1977.

As far back as the 1870s, some confectionary shops near Kyoto, Japan carried a cracker with the same folded shape and a fortune tucked into the bend, instead of its hollow inside. It’s called the “tsujiura senbei,” or “fortune cracker,” according to Jennifer 8. Lee, author of The Fortune Cookie Chronicles: Adventures in the World of Chinese Food, which recounts the history of the cookie.

The Japanese cracker, Lee wrote, was larger and darker, made with sesame and miso instead of the vanilla and butter used to flavor fortune cookies found in modern Chinese restaurants in America. Lee cited Japanese researcher Yasuko Nakamachi, who said she found these cookies at a generations-old family bakery near a popular Shinto shrine just outside of Kyoto in the late 1990s. Nakamachi also uncovered storybooks from 1878 with illustrations of an apprentice who worked in a senbei store making the tsujiura senbei, along with other kinds of crackers.

Lee says the fortune cookie likely arrived in the United States along with Japanese immigrants who came to Hawaii and California between the 1880s and early 1900s, after the Chinese Exclusion Act’s expulsion of Chinese workers left a demand for cheap labor. Japanese bakers set up shop in places such as Los Angeles and San Francisco, making miso and sesame-flavored “fortune cookie-ish” crackers, among other treats.

One of the most oft-repeated origin stories of the American fortune cookie cites the Japanese Tea Garden in San Francisco’s Golden Gate Park as the first known U.S. restaurant to serve the treat. The Tea Garden sourced their cookies from a local bakery called Benkyodo, which claims to have pioneered the vanilla and butter flavoring and to have invented a machine sometime around 1911 to mass-produce the cookies. But, says Lee, several other sources have also claimed to invent the cookie around the same time, including three Los Angeles-based immigrant-run businesses: Fugetsu-Do confectionary in the city’s Little Tokyo, Japanese snack manufacturer Umeya and the Hong Kong Noodle Company.

READ MORE: History of San Francisco's Chinatown

Japanese Internment Causes a Shift

WATCH: How Japanese Americans Were Forced Into Concentration Camps During WWII

How did fortune cookies migrate from Japanese bakeries to Chinese restaurants? American food preferences likely played a part.

Japanese emigres to the U.S. around the turn of the 20th century couldn’t open Japanese restaurants, says Lee, because Americans didn’t want to eat raw fish. “So in many cases, they actually opened Chinese restaurants because they were kind of going through a big renaissance with chop suey, chow mein, egg foo young.” And  Americans' expectation for dessert at the end of meals, says Lee, may explain why many of these restaurants began to offer fortune cookies with the check.

But the fortune cookie, once produced by Japanese Americans, eventually wound up in the hands of Chinese American manufacturers during World War II. After the Japanese bombed Pearl Harbor in 1941 and President Franklin D. Roosevelt ordered the relocation and internment of Japanese Americans through his Executive Order 9066, Japanese American businesses began to close, including the bakeries that once made fortune cookies. That gave Chinese American entrepreneurs an opening to produce and sell them.

More than 100 years later, fortune cookies remain a massive business. New York-based Wonton Food, the largest fortune-cookie producer, manufactures more than 4 million of them daily, with an estimated 3 billion cookies produced annually, wrote Lee.

READ MORE: Building the Transcontinental Railroad: How 20,000 Chinese Americans Made it Happen

Tanya Constantine/Getty Images
A family opening fortune cookies.

As fortune cookies became a staple in Chinese restaurants, they also became fodder for ethnic stereotyping.

Despite having historic roots in Japan and growing into a uniquely American business success story, the cookies became an easy shorthand for all things Chinese—along with other reductive and sometimes disparaging pop-culture stereotypes like squinty eyes, heavy accents and being good at math. In 2012 for example, MSG Network aired a fan sign of the New York Knick’s Taiwanese American basketball sensation Jeremy Lin, overlaying his face above a broken fortune cookie. The same year, ice cream makers Ben & Jerry’s briefly offered a “Taste the Lin-sanity”-themed frozen yogurt, complete with broken fortune cookies, before an outcry forced them to publicly apologize and remove the cookies from the recipe.

Using things like fortune cookies and takeout boxes as shorthands for Chinese culture is misleading, says Lee, given that they’re distinctly American inventions—and the global reach of American culture helps to perpetuate those stereotypes around the world. But despite misconceptions about its true origins and its misuse as a symbol of Chinese heritage, the fortune cookie still carries powerful resonance throughout American culture.

“You have the number of people who have been engaged through fortune cookies, you have fortune cookie little baby booties, fortune cookie jewelry,” says Lee. “It really speaks to Americans in a very profound way.”

READ MORE: The 8-Year-Old Chinese American Girl Who Helped Desegregate Schools—in 1885