You probably already know that processed food is bad for you. Twinkies, after all, are not eaten for health, but for the joy of chewing yellow sponge cake injected with non-perishable cream. But it might surprise you to know that there’s never been any real data to back this up.

Most researchers and nutritionists theorized that ultra-processed food makes you overeat, on top of being high in calories, sugar, and fat while being low in fiber. To test that hypothesis, researchers at the National Institute of Diabetes and Digestive and Kidney Diseases recruited 20 volunteers, evenly split by gender, and kept them in a special wing of the NIH Clinical Center for 28 days straight. Nutrition studies are often plagued by having too many variables you can’t control for. People who eat more processed foods also tend to have other factors that might influence their health, like having less money to pay for healthcare or less time to spend exercising. Just observing the general traits of folks consuming junk food won’t get you to any definitive conclusions—you can only ever get associations.

So instead of just observing what people ate, the NIH researchers prescribed and controlled every single meal, plus the amount of daily exercise the participants got. For the first two weeks, half of the group ate a diet rich in veggies, whole grains, and other unprocessed food, while the other half ate ultra-processed stuff. Every meal contained twice as many calories as the person would actually need to maintain their body weight, and everyone was told to eat as much or as little as they wanted. Then the groups swapped menus for the last two weeks of the study, which was published this week in the journal Cell Metabolism.

The most important part of this study, though, is that the meals were matched on their macros. Whether you were on the processed or unprocessed week, each meal had roughly the same number of carbs, fat, protein, fiber, sugar, and total calories. The researchers couldn’t match more specific categories, like added sugar or saturated fat, simply because it’s hard to find chips and fruit juice that are as low in those unhealthy nutrients as whole foods are.

Even eating these macro-matched meals, the folks eating ultra-processed food consumed an average of 508 calories more per day, mostly in the form of carbs and fat (protein intake remained the same, as did total fiber and total sugar consumption). Those extra calories added up to about 0.9 pounds of extra weight at the end of the two weeks compared to their baseline. In the end, though, they came out even—folks eating only unprocessed food lost an average of 0.9 pounds.

Part of this difference may have been from changes in appetite. While participants were downing whole foods, the hormones controlling appetite—PYY and ghrelin—shifted to favor less hunger. And it may also have had to do with the speed at which they ate. Chowing on processed stuff made folks eat faster, both in terms of grams and calories. Because it takes a while for your brain to get the signal that your stomach is full, eating too quickly can make a big difference in the total amount you consume.

Interestingly, the participants’ glucose tolerance, insulin sensitivity, and average blood glucose levels all remained unchanged. The researchers think this might have to do with the physical activity the participants engaged in. Prior research has suggested that exercise can temper the glucose response, though that’s not why the volunteers were prescribed physical activity. Most studies of metabolism involve being trapped in a hospital for days, where you’re mostly sedentary. The exercise in the study was just meant to match the amount of activity one would get on an average day in the outside world, so it was very low intensity—just three 20-minute bouts of cycling at 30 to 40 percent of their max heart rate. If even that amount of working out can influence glucose metabolism, that’s a great sign for promoting even small amounts of exercise.

Of course, none of this solves the systemic reasons that some people overindulge in junk food. As the researchers point out, processed foods cost less in both time and money, both of which may be in short supply if you’re not wealthy. But whatever level of whole-food-iness you can afford, this study suggests it’s well worth the investment.