The energy content of a food is a measure of how many calories the food contains. Your body needs a certain number of calories each day -- the required amount varies with your age, gender, weight status and activity level -- to maintain itself. Eating fewer than the required calories each day will result in weight loss, while eating more calories than your body requires on a regular basis will result in weight gain. Most foods have information about energy content printed on the label. However, for foods that don't, as long as you have access to information about the masses of different nutrients in the food, you can calculate energy content.
Multiply grams of carbohydrate in the food by 4 calories per gram. A calorie is a unit of how much energy is in a given amount of food, also called a kcal. Regardless of whether the carbohydrate in food is sugar or starch, all carbohydrates provide the body with 4 calories/gram, explains Dr. Lauralee Sherwood in her book "Human Physiology." Be sure not to include grams of fiber in your calculation -- despite the fact fiber is technically a carbohydrate, humans can't digest it, so it contains no energy.
Multiply grams of protein in the food by 4 calories per gram. It does not matter what kind of protein a food contains; all proteins provide the same energy per unit mass, because they're all composed of the same basic building blocks, explain Drs. Reginald Garrett and Charles Grisham in their book "Biochemistry."
Multiply grams of fat in the food by 9 calories per gram. Different kinds of fat vary slightly in their energy content -- some contain more than 9 calories/gram while others contain less. Regardless, the human diet tends to consist of a mixture of fats that average out to around 9 calories/gram, meaning that this relatively accurately assesses the energy content of a food due to fat.
Add the energy from carbohydrate, protein and fat. The total, in calories, is the energy content of the food. This is the same information available on a nutritional label, for those foods that provide nutritional information.
Be sure you don't include water weight in your calculations. For instance, a 100-gram slice of lean ham may contain nearly all its calories from protein, but not all 100 grams of the ham are protein -- most are water.
In order to do these calculations, you have to know the masses of carbohydrate, protein and fat in a food.