People who eat a lot of highly processed food take in more calories and gain more weight than those who stick to a minimally processed diet, a new study conducted at the National Institutes of Health finds.

Many real-world studies of diet and nutrition rely on participants to remember what they ate, which is notoriously difficult for most people. The results of the study are published Thursday in the journal Cell Metabolism.

This project was much more controlled. A group of 10 men and 10 women lived at the NIH’s Clinical Center in Bethesda, Maryland, for 28 days, their meals provided by investigators with the National Institute of Diabetes and Digestive and Kidney Diseases.

For the first two weeks, half of the subjects ate what was called an “ultraprocessed diet.” That included foods many would regard as reasonable options: turkey bacon, chicken salad made with canned chicken, sweetened Greek yogurt, bagels with cream cheese and baked potato chips.

The other half stuck with a minimally processed diet, including meats and fish, whole fruits and vegetables, eggs, nuts and oatmeal. The second two weeks, participants switched diets.

This is an example of what participants ate on the minimally processed diet: plain Greek yogurt, bananas, apple slices and walnuts, salt and olive oil. Hall et al / Cell Metabolism

“We found people over-ate on average more than 500 calories a day on the ultraprocessed diet,” study author Kevin Hall said. “They gained weight and gained body fat.”

Nutrition facts labels aren’t the whole story.

Even though both diets were matched to have the same amount of calories, sugar, fat, fiber and macronutrients such as carbohydrates and protein, people gained about two pounds while eating the processed foods. And they lost about that much on the other diet.

It may be that people tended to eat more quickly and consumed more fat and carbohydrates on the ultraprocessed diet.

Dietitians say the results confirm what they've seen in studies. "Satiety is higher and longer lasting when we eat foods that have been minimally processed," said Elisabetta Politi of the Duke Diet and Fitness Center in Durham, North Carolina.

This is an example of what participants ate on the ultra-processed diet: Honey Nut Cheerios, whole milk with added fiber, a blueberry muffin and margarine. Hall et al / Cell Metabolism

Blood tests were also telling. When participants were on the minimally processed diet, they produced more of a hormone called PYY that makes people feel full, and less of a hormone called ghrelin that stimulates appetite.

“This is the first study to show the nutrients on the nutrition facts labels aren’t the whole story,” Hall told NBC News. “There’s something else about those ultraprocessed foods.”

But what exactly are “ultraprocessed foods”? Some argue all food goes through some kind of process to ensure it gets from farms to our forks.

The study classified food as “ultraprocessed” if it contained ingredients known to come from industrial food manufacturing, such as hydrogenated oils, artificial flavors and other additives to stabilize products and increase their shelf life.

Hall suggests processed food is simply anything your grandmother wouldn’t recognize.

Real people have shown it’s really possible to transition away from highly processed foods. Lisa Leake, a mother of two in Charlotte, North Carolina, overhauled her family’s diet back in 2010, eliminating all ultraprocessed food.

Within days, Leake and her husband lost five pounds “without trying,” she said. They had more energy, and she said her levels of good cholesterol shot up by 50 percent within a year.

Leake, who recently released a cookbook called “100 Days of Real Food on a Budget,” told NBC News the key is to start by reading ingredients labels, choosing those that contain five or fewer whole ingredients.

And plan meals ahead of time, she said. “If you don’t know what your next meal is going to be, you’re going to find yourself starving at a drive-thru.”

FOLLOW NBC HEALTH ON TWITTER & FACEBOOK