In the past decade, testosterone replacement therapy has become much more common among older men hoping to boost their energy, fitness, and sex drive. But for many men, simple lifestyle changes can provide the same boost to testosterone as a drug and without the unwanted side effects of testosterone therapy. Key among them is working out.

But not all workouts are created equal when it comes to boosting testosterone. Although most kinds of movement are better than being sedentary, “the biggest gains that you get are going to be with high-intensity or resistance training,” says Jordan Foreman, M.D., a urologist at Duke Health.

In a 2003 study published in the journal Endocrine, seven male runners in their late 20s and early 30s did sets of intervals at different intensities: 60%, 75%, 90% and 100% of their VO2 max, which is the maximum amount of oxygen a person can use during high-intensity exercise. The researchers found that the men’s testosterone didn’t increase after the lower-intensity intervals. But after five minutes at 90% VO2 max, it shot up from an average baseline of 526 nanograms per deciliter (ng/dL) to 695 ng/dL. (Normal testosterone concentrations for men are anywhere from 300 to 1,000 ng/dL.)

Here’s the thing: After about an hour of rest, the runners’ testosterone levels returned to baseline. That finding is common throughout the scientific literature. “You have that transient increase in testosterone that tends to fall back down within a few hours after exercising,” Foreman says.

Scientists aren’t sure of the reason for this short-term burst, but it’s possible that when muscle fibers contract, whether you’re curling a heavy dumbbell or sprinting, they send a message to the testicles to produce more testosterone.

Even though these increases don’t last, they’re still significant for men’s overall hormonal health, Foreman says. That’s because testosterone levels vary throughout the day. Any boost in testosterone, even if it’s just for an hour or two, brings up your daily average, making you less likely to experience the symptoms of low testosterone.

For some men, exercise has another indirect, but more lasting, effect on testosterone, by encouraging changes in body composition. High body fat is a known contributor to low testosterone, Foreman says, because fat cells convert testosterone into estrogen.

In a 2018 study published in the journal Hormone and Metabolic Research, 44 men were placed in one of three 12-week aerobic exercise programs: light, moderate, or vigorous. By the end of the program, testosterone increased in the 28 men whose BMIs at the start of the experiment fell in the “overweight” or “obese” categories, but not in the “normal” weight men, suggesting that changes in body composition might be responsible for the improvements. (It’s worth noting that, once again, testosterone gains were more substantial in the vigorous program.) In another study of 90 men with “obese” BMIs who underwent a 16-week treadmill program, testosterone increased the most among men who lost the most belly fat.

If you’re interested in exercising to boost your testosterone, where should you begin? First, recognize that if you’re mostly sedentary, any movement will help your testosterone production — so pick up a fitness routine you’re likely to stick with.

“You can vary your exercises. We’re talking, like, push-ups and sit-ups — nothing you need a gym for,” Bennett says.

Consistency is key, adds Nelson Bennett, M.D., a urologist at Northwestern Medicine in Illinois. If you exercise on a regular basis, “that testosterone level is going to stay up longer,” Bennett says. In other words, that transient, post-exercise increase in testosterone is going to have more of an impact on your overall health if you’re getting a boost every day.

Also know that it’s possible to overdo it, especially with endurance sports like running and cycling. Study after study shows that endurance athletes and men engaging in rigorous cardiovascular exercise actually have lower testosterone than men who are sedentary. That doesn’t mean these sports are bad for your overall health, Bennett says. In general, they’re great for your bones, body composition, and cardiovascular fitness. But if you’re an avid cyclist with low T, consider lightening up on the ultra-long road rides and giving weightlifting or HIIT a try.