Only about one in five adults meet the federal guidelines for both aerobic and strength-focused exercise. Perhaps even more concerning, nearly one in four Americans fail to get any exercise whatsoever outside of work.

In some areas, residents tend to be more physically active than in others. In these cities, residents have greater access to gyms, recreation centers, and parks. Further, people in these cities take advantage of these many opportunities to stay active. To determine the American cities getting the most exercise, 24/7 Wall St. created an index based on two measures — the share of adults in a metro area who are physically active during their leisure time, and the share of the population that has access to areas for physical activities outside of their homes.

6. San Francisco-Oakland-Hayward, CA

> Physically active adults: 85.1%
> Pop. with access to exercise locations: 98.6%
> Obesity rate: 19.5%
> Adults in fair/poor health: 12.5%

Residents of Southern states are typically less active than residents in other regions. Of the 50 American cities getting the most exercise, only three are located in Southern states. At the same time, 41 of the 50 cities getting the least exercise are in the South. Residents of Western states tend to get the most exercise, and cities located in Western states account for 37 of the 50 cities on this list.

When there are fewer barriers to being physically active, more people tend to exercise. In Boulder, which ranks first on our list, more than 97.7% of the Colorado city’s population are within a 5-10 minutes commute from a place to exercise, compared to the 84% of adults nationwide. In Boulder, 90.6% of adults spend some of their leisure time being physically active, a larger share than in any other metropolitan area, and well above the national share of 77%. Of the 50 cities with the highest share of physically active adults, 39 have more access to exercise opportunities than the nation.

Ultimately, a city with a lower share of sedentary adults, even if they do not fully meet the federal guidelines for exercise, tend to have better health outcomes. For example, obesity rates in areas with active adults tend to be lower than in areas with less active adults. In 44 of the 50 cities on this list, the obesity rate is lower than the national rate of 27%. In addition, residents tend to feel healthier in the cities that exercise more. The 50 cities getting the least exercise all have a higher share of adults in poor or fair health than the nationwide share of 14%. Meanwhile, the majority of cities on this list have a lower share of adults who report poor or fair health than across the country as a whole.

To determine the cities getting the most exercise, 24/7 Wall St. created an index to rank the 381 metro areas by both the share of adults who are physically active as well as the accessibility to areas of exercise. Both measures come from the 2014 County Health Rankings & Roadmaps, a collaboration between the Robert Wood Johnson Foundation and the University of Wisconsin Population Health Institute. Obesity rates — the share of residents that report a body mass index greater than or equal to 30 — as well as the percentage of adults who report fair or poor health also come from County Health Rankings.

Click here to see the cities getting the most exercise.