As you sprint up the career ladder to success, you may find that your weight often goes up right along with it. But it’s not just a matter of too many doughnuts at those 9 a.m. meetings or a missed workout or two. On-the-job stress may be the simmering underneath that's secretly driving up those numbers on the scale.

“Workplace stress is one of the most common types of stress. After all, you spend most of your waking hours at your day job,” says Elissa Epel, PhD, a leading researcher on stress, aging and weight, and co-author of The Telomere Effect: The New Science of Living Younger. Several studies find that on-the-job strife is associated with risk of obesity and a widening waistline. A 2015 study in the International Journal of Obesity (London) added a new twist: Women who started out heavier were more prone to gaining weight under job duress.

Though research is inconsistent, one large meta-analysis on 160,000 adults found a “U”-shaped pattern. People under the highest strain at work were more likely to be obese — or underweight. And while work stress doesn’t have official status as an “obesogen” (a environmental factor that drives up weight overtime). Epel notes that work stress can make such an impact on your health, it can be considered to have an obesogenic effect.

Yikes. So we wanted to know: Do you really need to choose between your ambitions and your health? And, in order to reach your happy weight, does stress matter even more than diet and exercise?

Unless you work in a field where you’re up and moving all the time (say, you’re a personal trainer), research shows you spend about 10 hours on weekdays being sedentary. For women, clocking longer hours (49-plus per week) was associated with greater weight gain, in part because there’s little time left for self-care, like going to your favorite Spin class or meal prepping.

Then there are the late nights/answering emails/putting out fires that leave you sacrificing precious shut-eye, adding a piece to the stress-weight puzzle. “Nighttime is when stress has the most toxic effects because it prevents your body from recovering,” says Epel. If blood pressure and stress levels don't return to normal when you try to decompress — something super difficult when you can’t unplug anyway — you’ll make poorer dinner choices (hey, take-out) and lose sleep, something that can whack out your hunger hormones the next day and boost cravings for unhealthy stuff.

Your boss yelling at you, throwing a project on your desk at 5 p.m. that’s due the next day, the pressure to stay late, answer emails at all times and take work home with you — these things are the modern-day bear in the woods that cause cortisol levels to surge.

It's more than just diet and exercise

A 2016 Career Builder survey found that nearly half of US adults say they’ve gained weight at their job, women being more prone than men. But there’s a strong link between being overweight and having a high-stress job. In fact, 77 percent of workers who rate their stress levels as “high” say they’re overweight, compared to only 41 percent of those with low stress.

Evolutionarily, there’s a reason why your pants get tighter, says A. Janet Tomiyama, Ph.D., the director of the UCLA Dieting, Stress, and Health Laboratory. “In our past, we’d encounter physical threats, like being chased by a bear. When you get stressed, your cortisol spikes, which delivers a distress signal to your body to release energy into your bloodstream, where it can travel to muscles and help you run away faster,” she explains.

That’s all good when there are actually bears around. Today, you get these cortisol spikes when two things happen: 1) the stress feels uncontrollable and 2) it threatens your social status (like your role at work), explains Tomiyama. Your boss yelling at you, throwing a project on your desk at 5 p.m. that’s due the next day, the pressure to stay late, answer emails at all times and take work home with you — these things are the modern-day bear in the woods that cause cortisol levels to surge. The energy released into your muscles isn’t burned off, especially if you’re sitting at your desk all day. Without anywhere to go, it becomes fat.

Adding insult to injury: cortisol reprograms your brain. You know this already. For example: when you’re stressed, what type of food do you want?

a) A giant salad

b) A pint of mint-chip Talenti

c) Cheese fries

d) B and C and a handful of Kisses from the candy jar, bag of chips from the vending machine and a vanilla Frappuccino because now you’re thirsty.

Oh, D? Because these foods are chock full of fat and sugar, they can give your body the blast of energy it needs to tackle a stressor. It’s what your body is begging for, and quite frankly, it’s hard to fight biology. “Research shows your brain lights up more in response to these foods when you’re stressed. It prompts you to eat more and makes these foods taste even more delicious than usual,” says Tomiyama. The takeaway? A doughnut tastes better when you’re stressed.

You get cortisol spikes when two things happen: 1) the stress feels uncontrollable and 2) it threatens your social status (like your role at work).

Finally, when you feel burned out from work — the Sunday scaries hit hard, you feel like breaking down at your desk (or have), and you can’t think about why you’re even in that job in the first place — you’re more likely to fall victim to emotional eating and report having less control over your intake and binging, suggests research in The American Journal of Clinical Nutrition.

Beware this appetite-stoking combo

It’s this stress-plus-junk food duo that makes you prone to packing it on. Epel says this is best shown in animal studies. “If an animal is only stressed, it won’t dramatically impact their health and weight. But if you give them a terrible diet of cookies, chips and lard when they’re stressed, their body stores calories, particularly as visceral fat,” she explains.

The unfortunate reality is that psychological stress changes how your body metabolizes food in the first place— and not for the better. Consider the findings published in the journal Biological Psychiatry in 2015. In healthy women, a greater amount of daily stress led to a decline in resting metabolism, less fat burning and higher insulin levels. Researchers discovered that one stressor per day (compared to none) burned 104 fewer calories — “a difference that could add almost 11 pounds/year,” the researchers concluded.

In another study in 2016, the same team of researchers had two groups eat a fast-food-ish high-fat, high-cal meal. For one group, that fat came from healthy olive oil, another was high in saturated fat. In participants who were stressed out, their bodies showed an inflammatory response to the healthier meal that made it look like they actually ate the unhealthy food. Your body doesn’t benefit from your healthy diet as much when you’re feeling all frenzied.

“The takeaway is that healthy eating during a stressful time is more important than ever,” says Janice Kiecolt-Glaser, PhD, co-author of both studies and the director of the Ohio State Institute for Behavioral Medicine Research. Also, trying to avoid eating high fat meals when you’re stressed is best. Keep a lot of healthy snacks on hand and plan nutritious meals in advance so that “when you’re on the run, you don’t grab the first thing in your line of sight, which could be fast food,” she says. Exercise has also been shown to mitigate the negative effects of stress, so do your best to fit in some movement — even a 15-minute walk helps — every day.

And certainly, if your stress is leading to feelings of depression, seek out help. A bigger task is getting to the underlying source of all the strife: your job. It may feel like something you have no control over now, but “the social environment at your work is incredibly important,” says Epel. For everyday issues (you’re swamped by deadlines), small measures like learning better time management techniques can make a huge difference in feeling in control of your job.

For larger problems, you may need to take bigger action. “Sex and racial discrimination, sexual harassment or a generally hostile workplace is toxic and not uncommon — especially for women early in their careers,” says Epel. Often you can’t change who your boss is, but you can inquire with HR if it’s possible to shift your position at work. Though it’s not easy for anyone to switch jobs, polishing your resume and looking for something new may be exactly what you need to do now — at the very least it can give you momentum toward building a healthier future for yourself.