Ever wonder how they determine how many calories are in food?
Today, most of the nutritional information you find on food labels is generated indirectly, using what's known as the Atwater system. So basically, calories are calculated by adding up the calories provided by each of the food's energy-containing nutrients.
According to the Atwater system, there are on average four calories in each gram of protein, nine in each gram of fat, seven in each gram of alcohol, and four in each gram of carbohydrates. You've probably seen that conversion scale on the label of various potato chip bags.
Also, because some carbs contain fiber that your body can't break down, their total is adjusted accordingly before figuring out calories. Atwater came to these figures using a bomb calorimeter.
Using a bomb calorimeter is a much more involved process. You'd have to place your food in a sealed container, then submerge it in water. After that, since a calorie is defined as the amount of energy it takes to heat up a kilogram of water one degree centigrade, you'd burn the food and figure out how much the temperature of the water has changed.