To calculate food calorie, you need to know the amount of protein, carbohydrates, and fat in each serving. Multiply the grams of protein and carbohydrates by 4 and the grams of fat by 9. Add these numbers together to get the total calorie count. For example, if the item you're eating contains 20g of protein, 35g of carbs, and 15g of fat, you would multiply 20x4, 35x4, and 15x9 to find the number of calories contributed by each macronutrient—80, 140, and 135, respectively.