How it works
“Macros” are the three macronutrients that give food its energy: carbohydrate, protein, and fat. Enter how many calories you aim to eat each day and what share of them you want from carbohydrate and from protein. Fat gets the rest, so the three always add up to 100%. The calculator turns that into grams of each a day, the way they’re listed on nutrition labels.
Each gram of carbohydrate or protein has about 4 kilocalories (17 kJ), and each gram of fat about 9 (37 kJ). So the calculator finds the calories from each macro, then divides by its energy per gram.
The calculator doesn’t choose a split for you. The US National Academies suggest 45% to 65% of calories from carbohydrate, 10% to 35% from protein, and 20% to 35% from fat, and the calculator tells you if your split is outside those ranges.
The formula
Fat’s percentage = 100% − carbohydrate’s percentage − protein’s percentage
Calories from each macro = calories a day × its percentage ÷ 100
Grams of carbohydrate = calories from carbohydrate ÷ 4
Grams of protein = calories from protein ÷ 4
Grams of fat = calories from fat ÷ 9
- If you enter your target in kilojoules, the calculator first divides by 4.184 to put it in kilocalories (1 kcal is exactly 4.184 kJ).
Worked example
Want this with your own numbers? See Show the work above.
You’re aiming for 2,200 kcal a day, with 45% from carbohydrate and 30% from protein.
- Fat gets the rest: 100% − 45% − 30% = 25%.
- Carbohydrate: 2,200 kcal × 45% = 990 kcal, and 990 ÷ 4 = 247.5 g.
- Fat: 2,200 kcal × 25% = 550 kcal, and 550 ÷ 9 = 61.1 g.
- Protein: 2,200 kcal × 30% = 660 kcal, and 660 ÷ 4 = 165 g.
FAQ
How do I work out my macros?
Start with your daily calories (the calorie calculator can estimate them), choose your percentages, and multiply. On 2,000 kcal a day, 45% to 65% from carbohydrate is 900 to 1,300 kcal, which is 225 to 325 g at 4 kcal a gram.
What split should I use?
There’s no single right answer, and it depends on your goals and health. The ranges above are the US National Academies’ guidance. If you have a medical condition, or very specific training goals, a doctor or registered dietitian can help you choose.
Why does fat have more calories per gram?
Fat stores more energy in each gram: about 9 kcal, compared with about 4 for carbohydrate and protein. That’s why the same share of calories gives fewer grams of fat than of carbohydrate.
Does this work in kilojoules?
Yes. Choose kJ next to the calories, and the calculator converts them to kilocalories first, then uses 4 kcal a gram for carbohydrate and protein and 9 for fat. The FAO’s factors in kilojoules are rounded separately (17 kJ a gram for carbohydrate and protein, 37 for fat), so working in kilojoules from the start can give grams that differ by up to about 2%.
What about alcohol and fiber?
Alcohol also has energy (about 7 kcal a gram), and dietary fiber has less than other carbohydrates (about 2 kcal a gram). The calculator counts neither separately: it splits your calories between the three macros at 4, 4, and 9 kcal a gram.
Sources
- Energy per gram of carbohydrate, protein, fat, alcohol, and dietary fiber, and 1 kcal = 4.184 kJ: FAO, Food energy: methods of analysis and conversion factors, chapter 3, Calculation of the energy content of foods
- The Acceptable Macronutrient Distribution Ranges (carbohydrate 45% to 65%, protein 10% to 35%, fat 20% to 35%) from the National Academies: LibreTexts, Introduction to Nutrition Science, 4.2 Defining Nutrient Requirements: Dietary Reference Intakes
- 2,000 kcal at 45% to 65% carbohydrate is 225 to 325 g: BCcampus, Human Nutrition, Carbohydrate Recommendations, Dietary Sources, Nutrient Claims and Personal Choices
- 1,800 kcal at 10% and 35% protein is 45 and 157 g: Nutrition Essentials, chapter 6, Protein
- 120 kcal of saturated fat in a 2,000 kcal diet is about 13 g: OpenStax, Nutrition for Nurses, 2.2 Fats
Cite this page
APA (7th edition)
Mathlark. (2026, October 4). Macro calculator. https://mathlark.com/health/macro-calculator/
MLA (9th edition)
"Macro Calculator." Mathlark, 4 Oct. 2026, mathlark.com/health/macro-calculator/.
Related calculators
For informational purposes only. This is not medical advice. Talk to a healthcare professional about your situation.