The correlation between anxiety and not exercising is positive. That is, the less you exercise, the more likely you are to feel anxiety. Another way of looking at that is the more you exercise, the less anxiety you tend to feel.
Meta-analyses of scientific research have found this repeatedly:
“Overall the research evidence support the notion that exercise has psychological
benefits for participants. The majority (90%) of studies support both the anti-
depressive properties of exercise and the effect of exercise in combatting anxiety. In
addition, the studies reviewed generally substantiate the claim that improved mood
is associated with exercise.” Source
The anxiety-reducing effects of exercise appear to depend on the type of exercise you do—it must be aerobic—how much you do it, and how often.
“The results substantiate the claim that exercise is associated with reductions in anxiety, but only for aerobic forms of exercise. These effects were generally independent of both subject (i.e. age and health status) and descriptive characteristics…For state anxiety, exercise was associated with reduced anxiety, but had effects similar to other known anxiety-reducing treatments (e.g. relaxation)...Training programmes also need to exceed 10 weeks before significant changes in trait anxiety occur. ”
“The only variable that was significant across all 3 meta-analyses was exercise duration. Exercise of at least 21 minutes seems necessary to achieve reductions in state and trait anxiety, but there were variables confounding this relationship. As such, it remains to be seen what the minimum duration is necessary for anxiety reduction.” Source (opens pdf).
The mechanism by which this occurs is unclear. It may be related to release of cortisol or other stress hormones from the hypothalamaic-pituitary-adrenal (HPA) axis, but findings are mixed.