StatGardenREF. DESK
Calculators/Food/Kilojoules from Macros
Food

Kilojoules from Macros calculator

Total kilojoules in a food or meal from its protein, fat and carbohydrate content.

Published 27 August 2026

What this calculator does

Every packaged food label states protein, fat and carbohydrate in grams, and from those three numbers alone the total energy content can be worked out directly. There is no need to look anything up beyond the three standard conversion factors: protein and carbohydrate each supply about 17 kilojoules per gram, and fat supplies about 37, more than double.

This is also why a dish heavy on fat can carry far more energy than its weight suggests. A meal that looks modest in grams but is dressed in oil or cream can end up with the same kilojoule count as a much larger plate of lean protein and vegetables, simply because fat is more energy-dense gram for gram.

The formula

FormulakJ = 17 x protein (g) + 37 x fat (g) + 17 x carbohydrate (g)

Multiply each macronutrient by its energy factor and add the three together: protein grams times 17, fat grams times 37, carbohydrate grams times 17. The total in kilojoules divides by 4.184 to give the equivalent in calories (kilocalories), the unit more commonly seen on food labels in some countries.

TermMeaning
kJKilojoule, the metric unit of food energy used on most nutrition labels outside the United States.
kcalKilocalorie, commonly just called a "calorie" on food labels, equal to about 4.184 kilojoules.
MacronutrientProtein, fat or carbohydrate: the three nutrients that supply the body with energy.

The inputs explained

FieldWhat to enter
Protein (g)Grams of protein in the food or meal, as shown on the nutrition panel.
Fat (g)Grams of total fat, as shown on the nutrition panel.
Carbohydrate (g)Grams of total carbohydrate, as shown on the nutrition panel.

When to use it

Checking a nutrition label adds up

Labels list energy directly, but recomputing it from the macro breakdown is a quick sanity check, and it explains where the energy actually comes from rather than treating the total as a single opaque figure.

Building a meal from ingredients

When combining raw ingredients rather than reading a single packaged label, adding up the protein, fat and carbohydrate from each one and running the total through this calculator gives the energy for the whole dish.

Comparing two recipes with the same weight

Two dishes can weigh the same on a plate and still carry very different energy totals if one leans on fat and the other on lean protein and carbohydrate, because fat carries more than double the energy per gram.

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 does more fat change the kilojoule total?

Holding protein and carbohydrate steady and increasing only the fat content.

Protein 20 g, carbohydrate 40 g fixed
FatTotal kilojoulesTotal calories
0 g1,020 kJ244 kcal
5 g1,205 kJ288 kcal
10 g1,390 kJ332 kcal
15 g1,575 kJ376 kcal
20 g1,760 kJ421 kcal
30 g2,130 kJ509 kcal
Each extra 10 g of fat adds 370 kJ, more than double what the same 10 g of protein or carbohydrate would add.

How does more carbohydrate change the kilojoule total?

Holding protein and fat steady and increasing only the carbohydrate content.

Protein 20 g, fat 15 g fixed
CarbohydrateTotal kilojoulesTotal calories
0 g895 kJ214 kcal
20 g1,235 kJ295 kcal
40 g1,575 kJ376 kcal
60 g1,915 kJ458 kcal
80 g2,255 kJ539 kcal
100 g2,595 kJ620 kcal
Carbohydrate adds energy at the same rate as protein, 17 kJ per gram, so this line rises at the same pace as an equivalent protein table would.

Questions

What is the formula for kilojoules from macros?

kJ = 17 x protein (g) + 37 x fat (g) + 17 x carbohydrate (g). These are the standard Atwater-derived factors used on nutrition labels.

How do I convert the result to calories?

Divide the kilojoule total by 4.184. This calculator shows both figures together.

Why does fat contribute so much more energy?

Fat is more energy-dense than protein or carbohydrate, at roughly 37 kJ per gram against 17 kJ per gram for the other two, so gram for gram it supplies more than double the energy.

Can this work out the kilojoules in a whole meal, like a salad?

Yes, as long as you know or can add up the protein, fat and carbohydrate across every ingredient. There is no fixed kilojoule figure for a food like "a salad" on its own, since that depends entirely on what is in it and how it is dressed.

For the calories-out side of the energy equation, see the calories burned calculator, or for a full macro breakdown from a target calorie intake, the macro calculator.