Indoor fitness classes, which often result in heavy breathing in poorly ventilated rooms, can be risky. Her is a guide to help you decide if your gym is doing enough to prevent the spread of Covid-19.

Last summer, a 37-year-old fitness instructor in Hawaii taught a spin class to 10 people. He was perched on a bike in the front of the room, facing his students as he shouted instructions and encouragement. The doors and windows were closed, but three large floor fans created a breeze to keep everyone cool. As a precaution against Covid-19, all the bikes were spaced at least six feet apart. (At the time, the gym didn’t require people to wear masks.)

But just four hours after class, the instructor began feeling fatigued. By the morning he had chills, body aches, a cough and other respiratory symptoms. Soon, he tested positive for the coronavirus, and eventually, everyone who attended his class that day tested positive, too.

The outbreak didn’t stop there, though. A 46-year-old fitness instructor who attended the spin class went on to infect another 11 people during personal training sessions and kickboxing classes over the next few days, before falling ill himself and landing in intensive care.

The case of the Hawaii spin instructor was alarming because of the efficiency with which the virus left his respiratory tract and swirled around the enclosed classroom, reaching every person in the room. Among epidemiologists, thats known as a 100 percent attack rate, and it’s a lesson in why group fitness classes, which often encourage high-energy huffing and puffing in poorly ventilated classrooms, present such a daunting challenge to infection control.

At the same time, most public health experts agree that the drop in physical activity and weight gain that many people experienced during a year of pandemic living presents another set of risks to human health, and that communities need to find a balance between infection control and allowing people to return to their favorite fitness activities.

In the United States, gyms and fitness programs have reopened in some capacity in every state, allowing an estimated 73 million eager members to return to exercise. For the first time in more than a year, indoor group fitness classes were allowed to resume in New York City as of Monday, albeit at 33 percent capacity, and face coverings will be required.

The good news is that it’s possible to lower the risk of group fitness classes by improving ventilation, limiting class size, wearing a mask and increasing physical distance between participants.

Linsey Marr, an engineering professor at Virginia Tech and one of the worlds leading experts on viral transmission, is an avid exerciser herself and longed to return to her CrossFit sessions as the pandemic wore on. She worked with the owner of the gym, examining building plans and calculating potential class size and ventilation patterns in the facility.

Dr. Marr said the challenge with group fitness classes is that the participants often are breathing heavily. During a workout, people exhale and inhale at far higher volumes than when at rest.

If someone is there who happens to be infected, they are releasing more virus into the air, Dr. Marr said. And the people around them are breathing heavily too, so they are taking more in. You get this multiplicative factor. You are breathing four times as hard, and the person who is sick is breathing four times as hard, so you are breathing in 16 times more than you would under nonexercise conditions.

Because of the potential for heavy breathing, Dr. Marr suggested increasing the physical distance between participants at the workout space to 10 feet rather than the standard recommendation of six feet. To achieve that level of spacing, it required limiting the class size at Dr. Marr’s workouts to just 10 people.

The facility took additional measures to minimize the chances of infection.

The solution was to open multiple garage-style doors, even in the middle of the Virginia winter. To make sure the ventilation was adequate, the gym acquired a carbon dioxide monitor to measure the buildup of carbon dioxide in a room. Because humans exhale carbon dioxide, its level can be an indicator of how well a room is ventilated.

Under everyday conditions, such as while shopping at a supermarket, an indoor carbon dioxide reading of 800 parts per million suggests that ventilation levels are adequate to reduce the risk of breathing in other peoples exhaled germs. But given the heavy breathing that occurs during a workout, Dr. Marr advised trying to keep indoor carbon dioxide levels even lower, to around 500 parts per million, and to increase ventilation if the number begins to creep toward 600.

Wearing a mask during exercise is recommended by the Centers for Disease Control and Prevention, but Dr. Marr noted that with heavy breathing, mask material can quickly get moist and lose its effectiveness. The level of protection provided by masks is so variable that we cannot rely on them alone, she said.

So far, the strategy seems to be working. Dr. Marr said her gym hasn’t experienced any coronavirus outbreaks, even though her state doesn’t require gym goers to wear masks while exercising. We figured out if we kept all the doors open it should be pretty low risk, she said. But it was cold!

There was one instructor who contracted the virus from somewhere outside the facility, but the well-ventilated room and rules about physical distancing appear to have protected 50 people who were exposed to him during several different classes.

While Dr. Marrs gym is just a single case study, it shows that group fitness classes can continue safely during the pandemic, provided the facility focuses on ventilation and enforces distancing precautions and capacity limits. (Dr. Marr notes that CrossFit Inc. invited her to join its medical advisory board in December, and she helped crafta set of safety recommendations.)

We asked Dr. Marr and other experts to answer questions about how participants can decide whether their fitness class is safe to attend. Heres what they had to say.

Yes. While Covid can spread in any type of indoor class, risk is likely to go up as exercise intensity increases because breathing rates increase.

The volume of air someone breathes in and out every minute is called the minute ventilation rate, said Dr. Michael Koehle, the director of the Environmental Physiology Laboratory at the University of British Columbia and an expert on respiration during exercise. It naturally rises more during strenuous workouts, such as spin or dance classes, than in lighter workouts, such as yoga or Pilates.

At low intensities  yoga, Pilates and some strength work  you can breathe more through your nose, which is a natural filter, said Dr. Koehle. Another very important factor is that it is more comfortable to wear a mask during strength training and lower-intensity exercise than high-intensity exercise. People should still be wearing masks indoors.

This past August, an outbreak occurred among high-intensity exercisers at a fitness facility in Chicago. Everyone brought their own weights and mats, but not everyone wore masks. In that case, 55 out of 81 people (68 percent) who attended classes over an eight-day period at one facility came down with Covid-19. Early in the pandemic, 112 people in South Korea who took part in Zumba classes, or spent time with someone who did, were infected.

While gyms and fitness classes are advised to meet certain ventilation standards, it’s tough for the average person to know whether a building ventilation system is adequate for infection control. High ceilings are good, said Dr. Marr. If you can smell someone else, thats a bad sign.

Ideally, a group class should be held in a room with open windows and doors on opposite sides of the room to allow for cross ventilation. A classroom with only one entrance and no windows  a common situation in many gyms  probably does not have adequate ventilation to keep you safe. Adding several portable air cleaners to a space that lacks more doors or windows could help. It would be much better if you can get cross ventilation  opening doors or windows on opposite sides, said Dr. Marr. Thats what we specified in my gym, at least two open on opposite sides.

Overhead exhaust fans or window fans that pull air out of the room are fine. But avoid any class that uses fans to recirculate air and cool down the room. Fans that recirculate air in the room just increase the risk of viral spread.

While six feet of distancing is recommended by public health officials for most situations, Dr. Marr advises extending it to at least 10 feet  in front of you, to either side, and behind you  during exercise.

The rules vary by state. In Massachusetts, for instance, indoor classes must have enough room for people to stand 14 feet apart. If barriers between participants are installed, then six feet is considered adequate. South Carolina requires a 10-foot by 10-foot area (100 square feet) per person; New Jersey requires twice that. Montana has required fitness classes to take place outdoors, while South Dakota has no guidance. (You can find more details about different state requirements here.)

States have different rules for class size, with some limiting attendance to 25 percent to 40 percent of capacity, and others allowing no more than nine or 10 people per class. Dr. Marr notes that class size is best determined by how far apart people can stand. When people keep 10 feet of distance from one another on all sides, that often limits the class size to 10 people or fewer. If you can’t achieve that much space between you and other participants, including the instructor, it’s time to find a new class.

It’s a good idea to wear a mask, and many states require them, but you can’t rely on your mask to protect you entirely. Mask quality varies, and during exercise, masks get moist, reducing their filtering efficiency. And while many gyms require masks to enter, mask wearing often is not enforced or even required during exercise classes.

In the Chicago and Hawaii outbreaks, most people were not wearing masks. At the Hawaii gym, two participants wore masks during kickboxing sessions, but their infected instructor did not, and both became ill. The C.D.C. advises that to reduce SARS-CoV-2 transmission in exercise facilities, employees and patrons should wear a mask, even during high-intensity activities.

Not every facility will have a carbon dioxide monitor, but it’s worth asking your facility if they have one in the group fitness room and whether you can check it. If the carbon dioxide levels are below 600 parts per million (the closer to 500 the better), it’s a sign that the room ventilation is adequate for exercise. If the numbers start to increase, ask to open a window or door or leave the class. When Dr. Marr was attending an indoor swimming pool, she noticed ventilation levels in the room were poor, so she left.

The International Health, Racquet and Sportsclub Association, an industry group, has an initiative called the IHRSA Active & Safe Commitment to follow industry best practices to provide a safe environment. Facilities that sign the pledge promise to adhere to physical distancing and mitigation measures, safety protocols and contact tracing.

The IHRSA urges the gym to have a list of protocols on its website and at the facility. Additionally, gym owners may wish to install commercial door keyless entry systems to reduce viral transmission by providing a touchless method of controlling building access. At the bare minimum, protocols should include ventilation and fresh air exchange, capacity limits, distancing protocols and a clear mask policy. I would specifically ask about ventilation practices, if mask wearing at all times is mandatory, and if classes and equipment were to be spaced out to allow for appropriate social distancing, said Cedric Bryant, president and chief science officer for the American Council on Exercise.

Your risk for contracting coronavirus or developing serious illness drops dramatically if you’ve been vaccinated, but people who are vaccinated are still advised to take the same precautions as everyone else in public settings. And in most states, the people most likely to go to gyms or instruct a fitness class are younger and healthier, and therefore less likely to be among the first groups to be vaccinated. According to the IHRSA, 73 percent of gym and fitness class participants are 55 and younger.

While everyone should wash their hands and wipe down gym equipment, patrons should not judge a gym solely on how often it promises to clean and sanitize an area. ? We should still do what we did before, which is wipe down your machine when you are done, said Dr. Marr. Maintaining a normal level of cleaning is appropriate. But any extra time and effort a gym has, put it toward cleaning the air.

Dr. Marr notes that proper ventilation, physical distancing and class size limits will have the biggest impact on your safety. She recently posted on Twitter that ventilation is so important, she even had a nightmare about it.

I had my first Covid-19 related nightmare (that I remember),Dr. Marrs tweet read. I finished a hard, group workout in a gym. I looked around and panicked because I saw that all the doors were closed.

Tara Parker-Pope and

Click here for full podcast playlist.