How you commute can make a difference in your health as well as your happiness.

The average commute time in the United States is 25.4 minutes. But the time it takes to get to and from work can creep up to an hour or longer in some metropolitan areas.

For most of us, the question is not “do I commute?” but “how do I commute?”

Sitting in a car is probably the least healthy way to commute. Walking or cycling is certainly a wiser choice. But even public transit, it turns out, is a healthier alternative to driving.

Researchers say there are two things to consider.

One is that the more time you spend getting to and from work, the less likely you are to be satisfied and happy. A shorter commute makes for a more contented life.

The other is that for some people, commuting is a time to relax. A long commute might be better if it lets you unwind.

“The longer amount of time you spend in a car getting to and from work, the more time pressure you feel and the lower your overall satisfaction with your life,” explained Margo Hilbrecht, Ph.D., an associate director of research for the Canadian Index of Wellbeing.

She was the lead author of a study that concluded the more time people spend driving to work, the less happy they are with life in general.

“It is not just the amount of time you spend commuting, it is the quality of the commute and the time you do or don’t have for physical activity,” Hilbrecht told Healthline. “More physical activity is associated with a higher level of satisfaction in life. If you put in a full day at work and then have an extended commute, you don’t have a lot of time left to unwind.”

Read More: Protect yourself and your family from air pollution »

Plus, do you want to knock off a few pounds? Something as simple as not driving to work could help.

A 2014 study in the British Medical Journal concluded that people who drive to work are fatter and less healthy than people who get to work by public transit or any other means.

Women who got to and from work by any means other than a private vehicle had a body mass index (BMI) 0.7 points lower and weighed more than five pounds less than women who drove to work.

The difference was even greater for men. Men who did not drive to work had a BMI 1 point lower and weighed nearly seven pounds less than men who drove to work.

Driving to work is also bad for your lungs.

Cars, trucks, and buses produce a variety of noxious gases and particles that contribute to respiratory and heart diseases. So it’s no surprise that driving in traffic is bad for your health. Sitting in traffic can be even worse.

A recent study in the United Kingdom found that sitting at stoplights accounts for about 2 percent of the typical commute there. But those relatively few minutes are responsible for about 25 percent of the unhealthy particles that commuters breathe in during their drive.

“Air pollution was recently placed in the top ten health risks faced by human beings globally,” said lead author Prashant Kumar, a senior lecturer at the University of Surrey. “The World Health Organization linked air pollution to seven million premature deaths every year. Our time spent traveling in cars remained fairly constant during the past decade despite the efforts to reduce it. With more cars than ever joining the roads, we are being exposed to increasing levels of air pollution as we undertake our daily commutes.”

Intersections with lights are where drivers have to stop and start quickly. With drivers hitting the gas to get moving again when the lights turn green, levels of the tiny particles produced by vehicle engines are up to 29 times higher than in areas where traffic flows freely.

Problems are similar in the United States, if not exactly the same. For one thing, the average commute in the United Kingdom is about 90 minutes, more than three times longer than in the U.S. And in the U.K., the types of vehicles and engines that run on gasoline and diesel fuel are different.

The U.S. fleet has fewer diesel vehicles, especially cars, than the U.K., explained Janice Nolen, assistant vice president for national policy at the American Lung Association.

Diesel engines produce more tiny particles than gasoline engines, but fewer noxious gases like nitric oxide. Air pollution from vehicles is a little different in the two countries, but is bad in both.

“There are important health risks associated with traffic pollution,” Nolan told Healthline. “Those risks are significant. Traffic pollution is a risk, and not just to commuters caught in traffic. People who live within 300 to 500 meters of major roads are also exposed to high levels of pollutants. That includes about 45 percent of the total U.S. population.”

Read More: Exercise as Stress Relief »

It’s easy to say don’t live near a major thoroughfare. But it may not be practical to move more than 500 yards from the nearest traffic artery.

However, it might be practical to change the way you commute.

Public transit is a viable alternative to driving in many urban and suburban areas. It may also be possible to bike or walk to work, or to combine public transit with biking or walking. Some people may also be able to work from home a few days a week.

“Many desk jobs can be done from home a day or two a week,” Hilbrecht suggested. “It depends on your workplace culture and exactly what your work requires. But even if you go to the office every day, you might be able to move your hours earlier or later so you have a shorter commute. It can also help your overall satisfaction to get out and take a quick walk at lunchtime or use the gym if your workplace has one. Or you might be able to use what is being called ‘active transportation.’”

Active transportation is any kind of commuting that involves physical activity. For some people, that means biking or walking to work. For others, it means biking or walking part of the way, then taking some other form of transportation such as a bus, a train, or a shared ride.

People who drive to work tend to drive from home to office with little or no walking. People who take public transit almost always walk from home or a parking space to the transit stop, then from the transit stop to the office. The physical exercise can make a difference in your health.

Researchers looked at residents in Charlotte, North Carolina, before and after the city built a light-rail transit system (LRT). People who used the LRT reported they walked more when using the train than when they drove regularly. And they lost weight.

People who used the LRT had a 1.18-point loss in BMI compared to neighbors who did not use the new rail system. That BMI reduction is equivalent to losing more than six pounds. LRT users were also 81 percent less likely to become obese.

Cycling is another good alternative to driving.

“I used to drive to work and switched to biking,” said Larissa Collins, who works at the John W. Gardner Center for Youth and their Communities at the Stanford University Graduate School of Education. “A financial incentive from Stanford got a lot of us paying attention to not driving to work. But I do it now for the exercise and the stress relief. I feel better, happier, and healthier than when I was driving to work every day.”

Collins lives about three miles from her office, so biking is easy no matter the weather. She is considering a move. Part of her plan is making sure she can either bike all the way to work or bike part of the way, then take public transit.

“Riding my bike to work is so much more relaxing than driving, even if the drive is only a few minutes,” she told Healthline. “I get to work happy and feeling good and feeling energized. I don’t even need that cup of coffee to get me going when I sit down at my desk every morning.”