StatGardenREF. DESK
Calculators/Food/Food Calorie
Food

Food Calorie calculator

Total calories in a meal from protein, carbohydrate and fat grams, using the 4/4/9 rule.

Published 21 August 2026

What this calculator does

This food calorie calculator works out how many calories a meal or portion contains directly from its protein, carbohydrate and fat content, rather than needing to look up a packaged food’s printed calorie count. It uses the standard energy factors nutrition labelling is built on: 4 calories per gram of protein, 4 per gram of carbohydrate, and 9 per gram of fat.

This is a different question from calculators that estimate how many calories a person needs each day. Those work from body weight, age and activity level to estimate a target; this one works from the actual macronutrient content of specific food to total up how many calories are actually in it, whether checking a recipe, a homemade meal, or a food label’s numbers against its stated calorie count.

The formula

FormulaCalories = (protein g × 4) + (carbs g × 4) + (fat g × 9), per serving, × servings

Multiply protein grams by 4, carbohydrate grams by 4, and fat grams by 9, then add the three together for calories in one serving. Multiply by the number of servings for the total across the whole meal or batch.

TermMeaning
4/4/9 ruleThe standard energy density used on nutrition labels: 4 kcal per gram of protein, 4 kcal per gram of carbohydrate, 9 kcal per gram of fat.
kcal (kilocalorie)What food labels call "Calories": one kcal is the energy needed to raise 1 kg of water by 1°C.
ServingOne portion of the food as measured by the protein, carbohydrate and fat figures entered; the total scales up by however many servings are being eaten.

The inputs explained

FieldWhat to enter
Protein per serving (g)Protein content of one serving, in grams (check a nutrition label or a food database for this figure).
Carbohydrate per serving (g)Carbohydrate content of one serving, in grams.
Fat per serving (g)Fat content of one serving, in grams.
ServingsHow many servings are being counted, which can include fractions such as 1.5.

When to use it

Checking a recipe’s total calories

Adding up the protein, carbohydrate and fat in a recipe, per serving, gives a calorie count for a homemade meal that has no packaging or label to read from.

Cross-checking a food label

Multiplying a label’s own protein, carbohydrate and fat figures through the 4/4/9 rule and comparing it against the label’s printed calorie count is a quick way to sanity-check the numbers or spot a label that used a different energy factor, such as counting fibre separately.

Scaling a meal up or down

Once the per-serving macros are known, changing the servings figure alone shows the total calorie cost of eating a bigger or smaller portion, or the whole batch rather than one serving.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How do calories change as protein content increases, at a fixed serving size?

Fixed carbohydrate and fat, across a range of protein content.

40 g carbohydrate, 15 g fat, 1 serving
ProteinTotal caloriesShare from protein / carbs / fat
0 g295 kcal0% / 54% / 46%
10 g335 kcal12% / 48% / 40%
20 g375 kcal21% / 43% / 36%
30 g415 kcal29% / 39% / 33%
40 g455 kcal35% / 35% / 30%
60 g535 kcal45% / 30% / 25%
With no protein at all, the meal is 295 kcal (54% from carbs, 46% from fat). Adding 60 g of protein raises it to 535 kcal, at which point protein alone provides 45% of the total energy.

How does total calorie count scale with servings?

A fixed per-serving macro breakdown, across a range of serving counts.

25 g protein, 40 g carbohydrate, 15 g fat per serving
ServingsTotal caloriesCalories per serving
1395 kcal395 kcal
1.5593 kcal395 kcal
2790 kcal395 kcal
31,185 kcal395 kcal
41,580 kcal395 kcal
62,370 kcal395 kcal
Calories per serving stays fixed at 395 kcal regardless of how many servings are counted; only the total changes, reaching 1,580 kcal across 4 servings of this meal.

Questions

Why 4, 4 and 9 calories per gram, and not something else?

These are the Atwater factors, long-standing average figures for how much usable energy the body gets from each macronutrient after digestion. Fat contains more than twice the energy per gram of protein or carbohydrate, which is why high-fat foods are calorie-dense relative to their weight.

What about fibre and alcohol?

Fibre is a type of carbohydrate the body cannot fully digest, so some labelling standards count it at a lower energy value or exclude it from the carbohydrate figure used for calories; check which convention a given label follows. Alcohol carries its own energy factor, around 7 kcal per gram, which this calculator does not include.

Why might my own calculation not exactly match a food label?

Small rounding on the label’s protein, carbohydrate and fat figures, different treatment of fibre, and label-to-label variation in exactly which energy factors were used can all produce a small difference from a hand calculation. A gap of a few percent is normal; a large gap is worth double-checking against the label’s serving size.

How is this different from a calculator that estimates my daily calorie needs?

A daily-needs calculator such as a TDEE or maintenance calorie calculator estimates how much energy a person burns in a day, from body weight, age and activity level. This calculator instead totals up how many calories are actually contained in a given food or meal, which is an entirely separate question answered from the food’s own macronutrient content.

To work out how many calories your own body needs in a day, see the maintenance calories calculator or the TDEE calculator.