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
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.
| Term | Meaning |
|---|---|
| kJ | Kilojoule, the metric unit of food energy used on most nutrition labels outside the United States. |
| kcal | Kilocalorie, commonly just called a "calorie" on food labels, equal to about 4.184 kilojoules. |
| Macronutrient | Protein, fat or carbohydrate: the three nutrients that supply the body with energy. |
The inputs explained
| Field | What 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.
| Fat | Total kilojoules | Total calories |
|---|---|---|
| 0 g | 1,020 kJ | 244 kcal |
| 5 g | 1,205 kJ | 288 kcal |
| 10 g | 1,390 kJ | 332 kcal |
| 15 g | 1,575 kJ | 376 kcal |
| 20 g | 1,760 kJ | 421 kcal |
| 30 g | 2,130 kJ | 509 kcal |
How does more carbohydrate change the kilojoule total?
Holding protein and fat steady and increasing only the carbohydrate content.
| Carbohydrate | Total kilojoules | Total calories |
|---|---|---|
| 0 g | 895 kJ | 214 kcal |
| 20 g | 1,235 kJ | 295 kcal |
| 40 g | 1,575 kJ | 376 kcal |
| 60 g | 1,915 kJ | 458 kcal |
| 80 g | 2,255 kJ | 539 kcal |
| 100 g | 2,595 kJ | 620 kcal |
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.