In a din of firecrackers, cymbals and horns, a team of devotees carried the shrouded wooden statue of a serene-faced woman, holding her aloft on a brightly decorated litter as they navigated through tens of thousands of onlookers.

As the carriers nudged forward, hundreds of people were lined up ahead of them, kneeling on the road and waiting for the moment when the statue would pass over their heads.

Some wept after it did; many smiled and snapped selfies. “I love Mazu, and Mazu loves me,” the crowd shouted.

Mazu, sometimes known as the Goddess of the Sea, is the most widely venerated of dozens of folk deities that many people in Taiwan turn to for solace, guidance and good fortune. The huge annual processions to honor her are noisy and gaudy. And yet for many, they are also deeply spiritual events, acts of faith showing that Mazu and other spirits remain vibrant presences here, alongside Buddhism and Christianity.

Taiwan’s two biggest pilgrimages for Mazu — named Baishatun and Dajia after the temples that pilgrims set out from every year — recently have been drawing record numbers of participants. And a striking number of them are younger Taiwanese, in their teens or 20s, drawn to experiencing the traditions of Mazu, like throwing crescent-shaped pieces of wood in a ritual to divine their futures.

“I didn’t expect there’d be so many younger people taking the pilgrimage like this,” said Chou Chia-liang, 28, a fashion designer who had traveled from Taipei, Taiwan’s capital, for the Dajia pilgrimage, which starts in Taichung on the west-central coast. “People used to think the Mazu faith was for old people from the countryside. Look around here — it doesn’t seem like that.”

Like quite a few other pilgrims, Mr. Chou, in a show of reverence, was pushing along a cart carrying his own small statue of Mazu, usually kept at the temple in Taipei where he typically prays.

“This is a bit different from my family’s religion,” he said. “Most Taiwanese people are very tolerant. They don’t have the idea that ‘this is my faith and that is your faith, and they can’t go together’.”

Many Taiwanese people say they are proud of their right to choose from an abundance of faiths, especially in contrast to the tight controls on religion in neighboring China. Taiwan’s religious diversity and vitality forms a kind of subsoil of the self-governed island’s identity and values.

About one-fifth of Taiwan’s 23 million people count themselves as Buddhist, another 5 percent are Christian, and over half take part in Taoism and a range of related folk religions, including worshiping Mazu, also spelt Matsu. In practice, many people mix Buddhist and folk traditions as they pray for a healthy birth or a high score on an exam.

“Local religions have re-emerged strongly since the ’80s and ’90s,” said Ting Jen-chieh, who studies religions at Academia Sinica, a top research institute in Taiwan. “Before, they were found more in the villages, but now it’s across middle-class society too.”

The largest temples for Mazu and other deities are powerful, wealthy institutions that make money from donations and services, including memorials for the dead. At election times, candidates pay their respects here, as well as at Buddhist temples and Christian churches, mindful of the sway that religious organizations can have with voters.

Beijing also tries to exert influence.

For decades, the Chinese government, which claims Taiwan as its lost territory, has invoked shared religious traditions, including Mazu, to try appeal to Taiwanese people. Mazu also has followers in coastal eastern China where, the story goes, she was born around 960 A.D. in Fujian Province, and used her special powers to save seafarers from drowning.

Whatever Beijing’s efforts, many pilgrims spoke of Mazu as a distinctly Taiwanese goddess, who happened to have been born on the other side of the strait. Some brushed away the politics, and said they were worried that the pilgrimages were being sullied by too much glitz, including the troupes of dancers and pop songs blaring over loudspeakers.

“Many people like the noise and sound and light effects,” said Lin Ting-yi, 20, a professional spiritual medium who participated in Mazu’s pilgrimage in March. But, he added, “Whenever I want to talk to deities, I like to feel and pray quietly, alone.”

For generations, the pilgrimages involved mostly farmers and fishermen who carried Mazu statues through nearby rice paddies and along dirt paths.

Now, the pilgrimages reflect a much wealthier, more urbanized Taiwan. The Mazu processions pass by factories and expressways, where the chanting and fireworks compete with the roar of passing trucks.

During the processions, the Mazu statues have been known to stop at schools, military barracks, and, one year, a car dealership display room, whose employees hurriedly moved a vehicle from the spot where, the carriers told them, the goddess wished to rest.

Along the annual routes, local temples, residents, shops and companies set up stalls to offer pilgrims (mostly) free food and drinks — watermelon, stewed tofu, cookies, sweet drinks and water.

Despite the hubbub, some pilgrims described how, as they fell into a meditative walking rhythm, the noise of the firecrackers and loudspeakers fell away, and they sometimes struck up deep conversations, and friendships, with strangers walking beside them.

“While you’re walking, you can give yourself more time and space to think deeply about things you haven’t thought of before,” said Hung Yu-fang, a 40-year old insurance company employee who was doing the Dajia pilgrimage for a fourth year.

While the nine-day Dajia pilgrimage follows a preset route, the Baishatun pilgrimage is more fluid. It doesn’t set a precise path in advance, leaving followers to intuit which turns in the roads the Mazu statue will take and where she may stop.

When her carriers reached an intersection this year, a tense air settled over the pilgrims, waiting while the statue bearers shuffled and turned this way and that — by their account, waiting for Mazu to decide which direction she wanted to take. They cheered when Mazu headed off again.

At night, the carriers rested the Mazu statue in a temple, and hardier pilgrims slept in the temple or on the nearby streets. unrolling thin rubber mattresses.

As Taiwan industrialized, it seemed possible that such rituals might survive only as symbols of the island’s fading rustic roots.

“For some time, it was for the lower rungs of society. Just a few hundred people would take part in the pilgrimages,” said Professor Ting, the religion researcher. “Now it’s popular, but a lot of the new, younger participants only walk for a few days — not the whole journey — to experience it as Taiwanese culture.”

In recent years, the surge of participants has been spurred by media attention (Taiwanese TV covers the pilgrimages like they were major sporting events), online enthusiasts (Mazu’s progress can be followed on the temples’ phone apps), and ease of travel (trains are fast and efficient).

In 2010, the Baishatun pilgrimage drew around 5,000 registered participants; this year, nearly 180,000 pilgrims signed up, a figure that doesn’t include the tens of thousands who joined informally along the way.

When the pilgrimage reached the Beigang Chaotian temple in southern Taiwan — its main destination before turning home — Mazu was greeted by an eruption of fireworks and gongs, and overwhelming crowds. Nearly 500,000 people turned up that day, a record, said organizers.

Despite the heat and crowds, people lined up for hours to squeeze inside the temple and catch a glimpse of Mazu, wearing an embroidered headdress draped with pearls.

“I couldn’t squeeze inside the temple,” said Mr. Chou, the clothes designer, who this year managed to walk part of both major pilgrimages. “But that didn’t matter. This time I also invited friends along so they could also get a taste of more traditional culture.”