Carb-Protein-Fat Gram Calculator

Enter your calories and macro percentages to get carb, protein, and fat grams.

How it is calculated

Each percentage is first divided by the sum of the three percentages, so the shares always add up to 100%. Then carbs (g) = calories × carb share ÷ 4, protein (g) = calories × protein share ÷ 4 and fat (g) = calories × fat share ÷ 9, using 4 kcal per gram for carbohydrate and protein and 9 kcal per gram for fat. Grams are rounded to whole numbers. If you enter 50/30/30 (sum 110) the tool rescales it to 45/27/27 instead of warning you. Calories must be above zero, no percentage can be negative, and at least one must be above zero, otherwise no result appears. Alcohol, fibre and other calorie sources are not modelled.

Worked example

Target 2,000 kcal a day with a 40/30/30 split (sum 100, so no rescaling). Carbs: 2,000 × 0.40 = 800 kcal ÷ 4 = 200 g. Protein: 2,000 × 0.30 = 600 kcal ÷ 4 = 150 g. Fat: 600 kcal ÷ 9 = 66.7, shown as 67 g. The ratio line reads 40/30/30.

Try this example →

Common mistakes

  • Dividing fat calories by 4 instead of 9; a gram of fat holds more than twice the energy of a gram of carbohydrate, so fat grams look far too high.
  • Entering percentages that do not total 100 and expecting them to be used as typed; the tool rescales them, so 50/30/30 becomes 45/27/27.
  • Mixing formats, such as 40 for carbs but 0.3 for protein and fat; the shares are relative to each other, so carbs then take almost all the calories.
  • Using maintenance calories when the plan is for a deficit or surplus; the grams follow whatever calorie number you enter.
  • Treating the rounded gram values as exact; 67 g of fat is 66.7 g, so tracked totals can differ by a few calories.

Sources

About this calculator

Converting a calorie target and macronutrient percentages into grams relies on the fixed energy density of each macronutrient: carbohydrates and protein provide about 4 calories per gram, while fat provides about 9 calories per gram. So for a given daily calorie target, grams of each macro are calculated as (calories × macro percentage) ÷ 4 for carbs and protein, or ÷ 9 for fat.

Dietitians, personal trainers, and people following structured eating plans — like a 40/30/30 or ketogenic macro split — use this conversion to translate a percentage-based diet plan into an actionable daily target they can track with a food scale or nutrition app. It's a standard step in meal planning because food labels and tracking apps report grams, not percentages, so the percentages set by a coach or diet plan need to be converted before they're usable day to day.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    A useful cross-check is to turn the protein grams into grams per kilogram of body weight, since many plans set protein that way. With the default 2,000 kcal and a 25% share, the tool gives 125 g, which for a 70 kg person is about 1.8 g per kg. Percentages of calories can hide very different gram targets as the calorie total changes. Which split are you following, and does your plan quote protein by body weight?

Popular calculators

All Calculators