Calculating the ketogenic diet  




It is not necessary to do any calculations to operate the ketogenic diet - your dietician can do them all, and provide you with a list of menus, or an exchange list. However, if you want to get the best from the diet, you will need to understand how the diet works and to be able to "fine tune". Generally, using the ketogenic diet involves doing calculations. Fortunately, these are not very difficult, and can be handled by anyone, even if they are not a mathematical genius.

One essential for the diet is a pocket calculator; you will almost certainly find it useful, even if you use a computer program for the diet. It doesn't have to be any special calculator, but you will probably make less mistakes it is has big buttons and a big display. Always do the sums on the calculator (or on the computer) - don't rely on mental arithmetic.

All the calculations should be done to at least two decimal places, to ensure that there are no rounding errors introduced by the calculation process. All the factors used here are specified to two places eg 25.76, 3.17, 0.83. The emphasis in this section is to ensure that the calculations are done accurately - this does not imply that an excessive degree of accuracy is necessary in the diet, but is merely a sensible precaution to ensure that the calculations do not introduce any error.

Pounds and pints and things

The diet is much easier to calculate using the metric system of grams and millilitres. Unfortunately, recipes and other things are still sometimes specified in terms of other measures, in which case, this section will help you convert to metric.


Calories are what we are really interested in, because they are the real measure for food intake. To be more precise, we are interested in metabolic calories - how many calories food generates by metabolism in the human body. Since the basic metabolic process is well understood, it is possible to calculate this for each of the different organic chemicals that make up fat, protein and carbohydrate.

For the technical minded, a calorie (cal) is defined as the amount of energy (heat) necessary to raise the temperature of 1 gram (1g = 1 cubic cm = 1ml) of water by 1oC.

The calorie is rather a small unit, so it is normal to talk in terms of kilo calories (kcal) - units of 1,000 calories. The difficulty is that this unit is also called a Calorie (Cal), normally spelt like that, with a capital C.

Another measure of heat or energy is the joule, and the energy content of food is sometimes measured in kilo joules (kj) . To convert from kilo joules (kj) to kilo calories (kcal, Cal), multiply by 0.239.

Most food labeling is done in terms of kilo calories (kcal), but sometimes these are referred to as Calories (Cal). So now you know.

Metabolic factors

The three basic types of food - fat, protein and carbohydrate - have different metabolic factors; fats produce 9 kcal for every gram metabolised, whereas protein and carbohydrate each produce 4 kcal for every gram metabolised.

As usual, it is not as simple as that. There are many different types of fat, protein and carbohydrate, and each organic chemical has its own metabolic factor. It is possible to work out the metabolic factor directly from a chemical formula, since the metabolic processes are understood, and ultimately each metabolic factor can be measured in terms of the net number of ATP (adenosine triphosphate) molecules generated from a single molecule of the chemical. Thus, a molecule of glucose produces 36 - 38 molecules of ATP (depending on the precise chemical reaction). It is interesting that the thermodynamic efficiency of these processes is about 40% - much the same as the best that we can achieve with mechanical systems like cars or batteries.

Fats have the highest metabolic factor, which is why the body uses them to store energy, since they can store more energy per gram. The metabolic factor for fats ranges from about 8.2 to 9.2; the longer the chain length of the fat, the higher the metabolic factor. This is because the glycerol head does not get metabolised in the same way as the chains.

Proteins are chemically much more complicated than fats or carbohydrates, and there is much greater variety in their molecular structure. However, they are also usually very much larger, so these variations disappear statistically when looking at their metabolic factors.

The metabolic factor for carbohydrates varies from 3.7 to 4.2, depending on the type of carbohydrate. Monosaccharides have the lowest metabolic factor and complex starches the highest.

There are other classes of organic chemicals which we ingest. The most significant (although not from the point of view of the ketogenic diet) is alcohol, which has a metabolic factor of 7. There are also some other oddballs, like low calorie sweeteners, which have a low metabolic factor, because they are incompletely digested - thus sorbitol has a metabolic factor of 2.4.

Although the metabolic factors vary somewhat, it is conventional to use the standard values (9 for fat, 4 for protein, 4 for carbohydrate), and this will not lead to any great errors. Often, when food values are quoted, they have been adjusted to use these standard values; indeed, the European standard for food labeling requires that this be done.

So, for metabolic factors, remember (9, 4, 4,), but always look at the small print to see exactly what is being assumed.

Warning: there are two notable exceptions:

The ketogenic ratio

The main variable in the ketogenic diet is the ketogenic ratio. This is the ratio of fat to protein plus carbohydrate in the diet. It is very important to note that this is the ratio by weight and not the ratio by calories. A typical diet is the 3:1 diet, which, to produce 1,500 kcal, would contain 145.16g of fat and 145.16/3 = 48.39g of protein plus carbohydrate. This gives 145.16x9 = 1,306.44 kcal from fat and 48.39x4 = 193.56 kcal from protein plus carbohydrate (1306.44 + 193.56 = 1500 kcal).

The ratio determines how "ketogenic" the diet is - the higher the ratio, the more ketogenic (ie stronger) the diet. Typical ketogenic diets are operated in the range from 2:1 to 5:1. Below 2:1 it is difficult to achieve ketosis. As the ratio gets larger it becomes increasingly difficult to operate the diet because the choice of food that can be used becomes increasingly restricted. Practically, it is almost impossible to operate at a ratio greater than 4.5:1, except when tube feeding.

By comparison, a normal everyday diet has a ketogenic ratio in the range 1:2 to 1:3. This just demonstrates how far the ketogenic diet is from a normal diet and emphasises that the ketogenic diet is not a fad diet, but a serious medical intervention which should only be carried out under medical supervision.

It might seem rather odd to define the diet in terms of a ratio; in many ways, it would be simpler to define the ketogenic diet just in terms of the percentage of fat (by weight) in the diet, so that a 3:1 diet would be a 75% diet. The reason for using a ratio is historical. When the ketogenic diet was first introduced, the ketogenic ratio had a somewhat different meaning. As defined by Wilder, it meant the ratio of ketones to glucose in the diet - now that needs some explaining. When food is metabolised into energy, it is broken down into two types of chemical, ketones and glucose, which are then used by the body as its basic fuel. The whole objective of the ketogenic diet is to use ketones as the fuel for the brain in place of its normal fuel, which is glucose, and this is achieved by increasing the proportion of ketones (ketogenic) to the proportion of glucose (anti-ketogenic). Fat, protein and carbohydrate break down into ketones and glucose in different proportions:

  ketones glucose
Fat 90% 10%
Protein 46% 54%
Carbohydrate   100%

So, Wilder's original ketogenic ratio was:

(fat x 90% + protein x 46%) : (fat x 10% + protein x 54% + carbohydrate x 100%)

Now, the body prefers to use carbohydrate as the basic fuel, only using fat when there is not enough fuel available from carbohydrate, and only using protein as a last resort. As a result, if the body is getting the proper number of calories, almost all the carbohydrate will be converted to fuel, most of the fat will be converted to fuel and only a small proportion of the protein will be converted. Under these conditions, where only part of the food intake is being metabolised, the ketogenic to anti-ketogenic ratio will not be far different from the simplified ketogenic ratio that is now used.

Personally, I find it easier to think in terms of the % fat in the diet, rather than the ketogenic ratio of the diet, so both alternatives will be used in the calculations for the diet. For reference, the ketogenic ratio, % fat content and Wilder ratios are:

ketogenic ratio % fat content Wilder ratio
2:1 66.67 2.2:1
2.5:1 71.43 2.9:1
3:1 75.00 3.5:1
3.5:1 77.78 4.2:1
4:1 80.00 5.0:1
4.5:1 81.82 5.9:1
5:1 83.33 7.3:1

Diet parameters

All you need to know are the number of grams of fat, protein and carbohydrate you should use each day in the diet. Normally your dietician will work this out for you. However, it is a good idea to know how to do this yourself, to have a better understanding of the diet, to enable you to adjust the diet ("fine tuning") and to able able to check the calculations.

To do this calculation, it is necessary to know the number of calories to be provided per day, and the amount of protein, as well as knowing the ketogenic ratio to be used.

The number of calories per day is usually based on the standard US   Recommended Dietary Allowance  . This is not very detailed; the basic figures are:

Age Weight (kg) kcal kcal/kg
0 - 0.5 6 650 110
0.5 - 1 9 850 95
1 - 3 13 1,300 100
4 - 6 20 1,800 90
7 - 10 28 2,500 90
11 - 14 (m) 45 2,500 55
11 - 14 (f) 46 2,200 47

For the MCT oil diet, the standard RDAs are usually used directly. For the classical diet, it is normal to restrict the calories to 65 - 70% of standard. Current recommendations from Johns Hopkins are:

Age kcal/kg
0 - 1 80
1 - 1.5 75
1.5 - 3 70
4 - 6 65
7 - 8 60
9 - 10 55
11 + 37.5 - 45

In practice, your dietician is likely to use judgement, based on the weight, height, fatness and general health of the child, to decide the actual number of calories.

The other thing that is necessary is to decide how much protein should be in the diet. Here, there is a conflict; general dietary practice says that there should be at least 1g of protein per kg of body weight and also that protein should be at least 10% of the dietary intake. However, with the higher ketogenic ratio diets, it becomes difficult to achieve these levels, because it leaves so little carbohydrate. That fact that the carbohydrate level becomes very low is not a problem in itself, but it is a practical issue, because the food choices become so restrictive - most foods have at least some carbohydrate in them, and many have have an impossibly large amount. On the higher ketogenic ratio diets, even the carbohydrates in medicines can become a problem. Again, the answer is a matter of judgement for the dietician, and it may be necessary to restrict the period that a high ketogenic ratio diet is used in order to prevent excessive protein depletion.

Given all these variables, each individual diet is likely to be different, but it is possible to provide a rough guide for ketogenic diets at different ratios. The following table shows the factors by which the RDA in kcal must be multiplied to obtain the daily requirements in grams:

ketogenic ratio fat protein carbohydrate
2:1 0.0909 0.0136 0.0318
2.5:1 0.0943 0.0133 0.0244
3:1 0.0968 0.0133 0.0190
3.5:1 0.0986 0.0133 0.0149
4:1 0.1000 0.0133 0.0117
4.5:1 0.1011 0.0133 0.0091
5:1 0.1020 0.0133 0.0071

: this table is based on a two year old child weighing 18kg. The diet will vary slightly for different ages and weights.

To get to a particular diet, you need to know the ketogenic ratio and the RDA. Then look up the factors for the appropriate ketogenic ratio and multiply by the number of calories. Thus, if the diet is a 4:1 (80%) diet at 1,350 kcal, the daily requirements are:

Fat 0.1000x1,350 = 135.00
Protein 0.0125x1,350 = 16.87
Carbohydrate 0.0125x1,350 = 16.87

Doing the sums

The calculation comes in two parts, calculating the quantities of fat, protein and carbohydrate in a meal, and then balancing the ingredients to get the right ketogenic ratio. The first part is easy. The second part is laborious, and can be very difficult when you are first learning.

The important thing to remember is that everything should be done in grams. Forget calories and all those other funny measures, use grams all the time.

The starting point is the three daily requirements that were given to you by the dietician (or that you have calculated) for fat, protein and carbohydrate. As an example, I will use the figures just given for a 4:1 (80%) diet at 1,350 calories. These are 135.00gF (fat), 16.87gP (protein) and 16.87gC (carbohydrate).

It is usual, with the ketogenic diet to give three or four meals a day, each with the same calories, and each with the correct ratio. So, if we are on a three meal regime, the quantities are: 135.00/3 = 45.00gF, 16.87/3 = 5.62gP and 16.87/3 = 5.62gC. You will note that these are quite small amounts, which is the reason we are working to an accuracy of 2 decimal digits throughout. In fact, let's multiply everything by 100, getting 4500F, 562P and 562C. There is a good reason or this, apart from getting rid of those irritating decimal points.

Let's say that it is breakfast and we want to cook scrambled eggs with a garnish of bacon and kiwi fruit plus coffee (no sugar).

The ingredients for the meal are eggs, butter, cream, bacon, kiwi fruit and coffee beans (yes, the beans need to be counted as well). We need to know the food values for each of these ingredients. They can be obtained from a variety of sources, sometimes the food package, sometimes a reference book. Food values are normally quoted per 100g, and we can use these values directly (rather than dividing to get the values per gram), since we had the foresight to multiply the meal quantities by 100. Sometimes, particularly in the US, food values are only quoted per serving portion, which might be anything, and is usually quite small like 10g or 14g. It is not recommended to use such values, because they will be too inaccurate - this is discussed further under   Food values  .

Right, so now we have assembled the appropriate food values per 100g:

  Fat (gF) Protein (gP) Carbohydrate (gC)
eggs 10.8 12.5 0
butter 81.7 0.5 0
cream 48.0 1.7 2.7
bacon 44.8 23.1 0
kiwi fruit 0.5 1.1 10.6
coffee beans 0 0.3 0.5

There are quite a lot of comments that it is worth making at this point, although many of them will be amplified under   Cooking the ketogenic way  :

It is extremely useful to have three balancing ingredients in each meal, one with a high fat content, one with a high protein content and one with a high carbohydrate content. The reason is that these three ingredients can then each have their quantities tweaked independently to get the right amount for the three food types, without greatly affecting the other food types. In the case of this meal, they are butter, bacon and kiwi fruit.

Now, all we have to do is to determine the quantities of each ingredient to achieve the right ketogenic ratio. There are constraints on doing this. For example, eggs come as one egg or two eggs, not as so many grams of egg; and while it is possible to adjust the ingredients in a particular recipe, eg scrambled eggs, to some extent, there are limits beyond which the food becomes unacceptable, or the recipe does not work.

So, we start off by setting so initial values for each ingredient. This will be difficult at first, but you will soon get to the point where you know enough about the food values to make a much better first shot. Given the initial values, you can then calculate the fat protein and carbohydrate content of the meal by multiplying each quantity by the appropriate food values, and adding them all together. Compare this against the target and calculate the error:

  Amount(g) Fat Protein Carbohydrate
eggs 30 30x10.8 = 324 30x12.5 = 375 30x0 = 0
butter 5 5x81.7 = 409 5x0.5 = 3 5x0 = 0
cream 20 20x48.0 = 960 20x1.7 = 34 20x2.7 = 54
bacon 10 10x4.8 = 448 10x23.1 = 231 10x0 = 0
kiwi fruit 20 20x0.5 = 10 20x1.1 = 22 20x10.6 = 212
coffee beans 10 10x0 = 0 10x0.3 = 3 10x0.5 = 5
sum 2151 668 271
target 4500 462 462
error -2349 206 -191

So, we need a lot more fat (a common problem), we have too much protein, which is unusual, and not enough carbohydrate, which is extraordinary. What do we do? Unfortunately there is no simple rule for working out a better answer - it is necessary to look at the figures and make some intelligent guesses.

First, that carbohydrate; we can fix it easily by adjusting the amount of kiwi fruit, since this does not affect the protein or fat content significantly; so forget about that problem for the moment. The protein is way out, 50% more than we need. We can't do much about the egg, since 30g is one small egg, so we have to do something about the bacon; in fact we had better get rid of all of the bacon. That leaves us with the fat. We can't put the cream up, because that will increase the protein, so we need a lot more butter. So let's try again with more butter and no bacon:

  Amount(g) Fat Protein Carbohydrate
eggs 30 30x10.8 = 324 30x12.5 = 375 30x0 = 0
butter 40 40x81.7 = 3268 40x0.5 = 20 40x0 = 0
cream 20 20x48.0 = 960 20x1.7 = 34 20x2.7 = 54
bacon 0 0x4.8 = 0 0x23.1 = 0 0x0 = 0
kiwi fruit 20 20x0.5 = 10 20x1.1 = 22 20x10.6 = 212
coffee beans 10 10x0 = 0 10x0.3 = 3 10x0.5 = 5
sum 4562 454 271
target 4500 462 462
error 62 -8 -191

That's not too bad, let's take a little bit of butter out to put the fat right, and put the kiwi fruit up to deal with the carbohydrate:

  Amount(g) Fat Protein Carbohydrate
eggs 30 30x10.8 = 324 30x12.5 = 375 30x0 = 0
butter 39 39x81.7 = 3186 39x0.5 = 20 39x0 = 0
cream 20 20x48.0 = 960 20x1.7 = 34 20x2.7 = 54
bacon 0 0x4.8 = 0 0x23.1 = 0 0x0 = 0
kiwi fruit 38 38x0.5 = 19 38x1.1 = 41.8 38x10.6 = 403
coffee beans 10 10x0 = 0 10x0.3 = 3 10x0.5 = 5
sum 4489 473 462
target 4500 462 462
error -11 11 0
% error 0% 3% 0%

That's about as good as we will get; ideally we should finish with at least as much protein as the target, and no more carbohydrate than the target, so that both are on the safe side. The aim should be to get the errors in each amount to be less than +/- 5%, which we have done.

Again, there are a number of comments:

  Amount(g) Fat Protein Carbohydrate
scrambled egg 45 45x26.9 = 1211 45x8.8 = 396 45x0.6 = 27
coffee with cream 15 15x16.0 = 240 15x0.8 = 11 15 x 1.2 = 18
eggs 0 0x10.8 = 0 0x12.5 = 0 0x0 = 0
butter 34 34 x 81.7 = 2778 34x0.5 = 17 34x0 = 0
cream 5 5x48.0 = 240 5x1.7 = 9 5x2.7 = 14
bacon 0 0x44.8 = 0 0x23.1= 0 0x0 = 0
kiwi fruit 38 38x0.5 = 19 38x1.1 = 42 38x10.6 = 403
coffee beans 0 0x0 = 0 0x0.3 = 0 0x0.5 = 0
sum 4487 475 462
target 4500 462 462
error -13 13 0
% error 0% 3% 0%

What this tells us is that a lot of extra butter and some extra cream are necessary to make the meal ketogenic. No problem about using the extra cream in the coffee, or in the scrambled eggs. Whether we can produce an acceptable scrambled egg with so much extra butter is more questionable - the only thing to do is to try, and see whether the result is acceptable - at least you will know for next time.

So, that's how its done; the calculations are tedious, but not very difficult. The hardest part is making the adjustments to the quantities to achieve the right ketogenic ratio, and ensure an edible meal. Practice makes perfect. After a while you will develop a feel for the figures, and be able to make a good initial choice and iterate to a good solution quickly.

Usually, it will only be necessary to do the calculations for a meal plan once, and afterwards the same figures can be used every time the keto kid wants scrambled eggs for breakfast. It is only necessary to do the calculation again when the diet parameters change, because you go to a different ketogenic ratio, or because the target weight is changed.

So, the calculation can be summarised as a number of steps:

1 Use grams throughout the calculation, never calories
2 Multiply the RDAs by 100
3 Calculate the meal quantities
4 Obtain the relevant food values per 100g
5 Make an initial estimate of the quantities and calculate the error
6 Adjust the most difficult ingredients first
7 Iterate to find an answer with errors of less than 5%
8 Don't estimate individual ingredients to a greater accuracy than 1 gram

Checking the calculation

It may not be so easy to do the sums, but it is very easy to check the results. Even if the calculations were done by someone else, like your dietician, they just could be wrong.

To check the calculation, add the amount of protein (in grams) to the amount of carbohydrate. Multiply by the ratio and the result should be the amount of fat. Because of the rounding errors in doing the calculations, the amount of fat may be slightly different, but it should be within about 1 gram.

As a formula:

(protein + carbohydrate) x ratio - fat < +/- 1g

As a series of steps:

1 Add the quantity of protein to the quantity of carbohydrate
2 Multiply by the ratio (ie by 3 for a 3:1 ratio)
3 Subtract the quantity of fat
4 Result should be less than 1 gram

Remember that sometimes, the individual meals may not be balanced, for example when a high fat drink is used with the meals, so that it may be necessary to check the meals for the day as a whole, rather than just the individual meals.

You should always check your own calculations, and if the calculations were done by your dietician, you should always double check them.

Computer programs

Now you can understand why people want a program to help with calculating the ketogenic diet. However, while a program can help with the mechanics of calculating the diet, you should remember that doing the calculations yourself will give a better intuitive understanding of suitable balances of foods.

The ideal computer program would have five features:

(link not working)    Keto Perfect

This program was developed by Jorge Saravia, and is based on the Johns Hopkins protocol. It is not very well explained, but appears to do what is wanted. There are a set of basic meals which can be modified from a database of 150 ingredients. There are some limitations; additional ingredients are not allowed, and it is only possible to exchange ingredients from related groups, although this is not explained either. However, the program does adjust the ingredients automatically to balance the meal. It also enables medications to be factored in. The program runs on a basic pc under Windows.

Keto meal planner

This was developed by Mike Gillick a keto parent at PHP, Santa Clara. The keto meal planner is a very basic tool. It provides a table of 300 food values, which you can update, and a calculation page. You enter the ingredients you want for a meal, and the quantities; the program then calculates the total calories and the total grams for fat, protein and carbohydrate. Adjustment of quantities to balance the meal is done manually. The program is an Excel worksheet, and so you will need Microsoft Excel to be able to use it. This is probably the most widely used tool.

Nutrigenie diet meal planner

This is a commercial program (cost $49) based on the Stanford diet protocol. It has a data base of 8,000 food values (not all relevant). Entry of ingredients and quantities is convenient, but the adjustment of quantities to balance the meal must be done manually. This is difficult, because the fat/protein/carbohydrate ratio for a given ingredient is not shown. The program runs on a pc under Windows.

Ketogenic Diet Software

Developed by Robert Stump. A basic program, in which you must enter your own food values, and balance the meal manually. I have been unable to get the software to work. The program runs under DOS on a pc.

Using exchanges

return to   Practical management of the ketogenic diet
continue to   Food values



(checked: 23 November 2002)
(update 2.3: 18 July 2002)
(issue 2: 25 May 1998)