Calorie Formula

The calories in food come from its macronutrients. Each gram of protein, carbohydrate, and fat contributes a fixed amount of energy.

Calories = (Protein × 4) + (Carbs × 4) + (Fat × 9)

Where

Protein grams of protein
Carbs grams of carbohydrate
Fat grams of fat

Worked example

A food with 30 g protein, 40 g carbs, and 10 g fat has (30×4) + (40×4) + (10×9) = 120 + 160 + 90 = 370 calories.

Alcohol adds 7 calories per gram. Fat is the most energy-dense at 9 per gram, which is why high-fat foods are calorie-heavy for their size.

FAQ

Does this formula account for cooking losses like fat rendering out of meat? Not directly. It calculates calories from the ingredients as measured, so if fat renders out and is discarded during cooking, like draining ground beef, the finished dish typically has somewhat fewer calories than the raw ingredient total would suggest.

Estimate needs with the Calorie and TDEE calculator in the cooking calculators.

A worked example

A food with 20 grams of protein, 30 grams of carbohydrate, and 10 grams of fat has 20 times 4, plus 30 times 4, plus 10 times 9, which equals 80, plus 120, plus 90, for a total of 290 calories. Fat has more than twice the energy per gram of protein or carbohydrate, which is why fatty foods are calorie dense.

How accurate is it

The factors of four, four, and nine are standard averages, and real foods vary a little. Nutrition labels are rounded and are allowed some margin of error, so the figure on a package may differ from the calculation. Alcohol adds calories as well, at about 7 per gram. Use the result as an estimate, since individual needs and absorption differ.

Scroll to Top

The calculators and tools on Formula Factory are provided for general guidance and informational purposes only. Results are estimates based on standard formulas and the values you enter — they do not constitute professional engineering, electrical, or architectural advice. Always verify calculations with a qualified professional before making decisions for any safety-critical, code-compliance, or commercial application. Formula Factory makes no representations or warranties as to the accuracy or completeness of any result, and accepts no liability for errors, omissions, or any outcomes arising from reliance on this information.