Luca and Lennyn Fantasia, ages 7 and 5, were bouncing around the Park Ridge, Ill., Memorial Day parade in May in giddy holiday mode. They wore red, white and blue outfits, admired the marching band and darted in the street to scoop up hard candy.

Their parents, Megan and John, were quietly discussing whether it was safe to even be there.

“We had this conversation right before we came,” said Ms. Fantasia, a physician assistant, adding that they had chosen a spot near the beginning of the parade route, reasoning that it was the best place to be if they needed to make a quick exit.

“The kids love this kind of stuff,” she said. “We don’t want to miss out on experiences. But is it really worth it?”

Americans will gather in packed, public celebrations around the country on Tuesday, in both big cities and small towns, marking the Fourth of July with festivals, Main Street parades and fireworks shows.

But as mass shootings have proliferated across the nation in recent years, some people say they have increasingly felt a sense of unease or fear of gun violence overtaking their sense of security at public events that were once considered unquestionably safe, whether concerts, worship services or parades. Others will carry on their holiday celebrations without concern, saying that they consider the possibility of random violence to be remote.

But for many, especially in the Chicago area, the fear of gun violence has particular resonance. Tuesday marks the one-year anniversary of a mass shooting that took place at a Fourth of July parade in Highland Park, Ill., a suburb 25 miles north of the city.

The massacre unfolded as a man climbed onto the roof of a downtown business with a high-powered rifle and fired into the crowd, killing seven people and injuring dozens. Robert E. Crimo III, 22, who faces 117 criminal charges, including murder, has pleaded not guilty.

The city of Highland Park is observing the national holiday and anniversary not with a traditional parade, but with a memorial ceremony, community walk, picnic and concert. The city says security will include metal detectors and bag checks.

Jacqueline von Edelberg, an artist and activist in Highland Park, said she plans to attend the day’s events, but acknowledged that many people have opted out.

“Some people are going in enthusiastic about it because they want to stand in solidarity with people, and other people can’t put themselves in that kind of environment,” Ms. von Edelberg said.

Having to consider security risks at public gatherings these days, she said, “is indicative of how normalized gun violence is in America.”

As if to underscore the issue as the holiday approached, at least two people died and 28 others were wounded in a shooting at a block party in Baltimore early on Sunday, the police said. A motive for the shooting, which was reported at 12:30 a.m. in Baltimore’s southern neighborhood of Brooklyn, was unclear.

In Chicago’s suburbs, police departments have added more officers to protect Fourth of July events.

In Evanston, just north of Chicago, city officials announced that there would be an increased presence of police officers, heightened security at intersections along a parade route there, K-9 patrols and drone flights.

Other suburbs, including Glencoe, have pledged to add more security and traffic controls during their holiday events.

Research shows that Americans view gun violence as a growing threat in their communities, whether they live in rural areas, suburbs or cities.

A poll conducted last year by the University of Chicago Harris School of Public Policy and The Associated Press-NORC Center for Public Affairs Research showed widespread fears of armed attackers. About 4 in 10 Americans believe it is at least somewhat likely that they will become a victim of gun violence within the next five years, with young adults the group most likely to report that concern, the survey said.

Those fears can be amplified during events that are outdoors and difficult to secure, even with police officers present.

“Everybody goes out to crowded public events, even sometimes,” said Jens Ludwig, the director of the University of Chicago Crime Lab. “It’s really striking that this is now a shared feature of the American experience: to worry and hope that some mentally ill person isn’t also there with an AR-15.”

In some cases, guns have not been the issue. In 2021, the driver of an S.U.V. plowed through an annual Christmas parade in Waukesha, Wis., killing six people and injuring dozens more.

Some people at the parade in Park Ridge, Ill., in May said that they still felt safe in public, or were determined not to let their experience be clouded by worries about security.

“I’ve been going to this for 50 years,” said Sue Caldwell, 85, as she walked over to the Memorial Day parade in Park Ridge. “We can’t just give up on everything.”

Sharone Marck, a 49-year-old lawyer in Highland Park, is one resident who has decided to avoid the festivities on the Fourth of July.

She was at the parade in Highland Park last year. After she heard the staccato pop of gunshots and saw people fleeing, she dropped what she was holding in her hands, grabbed her young son and her mother and helped them sprint away to safety.

This year, both of her children will be away at camp. Ms. Marck and her husband are planning to join their neighbors for a cookout, have some drinks and listen to music, away from the center of town, where the shootings took place.

“I want to go there to pay my respects, but I don’t want to go with hundreds of people and a huge police presence,” she said.