{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"calories-from-macros"},"result":{"entity_type":"calculator","id":"calories-from-macros","calculator_id":"calories-from-macros","canonical_url":"https://tttkmbb.com/food/calories-from-macros","name":"Calories from Macros Calculator","title":"Calories from Macros – Energy and Percent Split from Protein, Carbohydrate, Fat and Alcohol Grams","category":"food","category_name":"Food & Cooking","tool_name":"calculate_calories_from_macros","featured_mcp_tool":false,"description":"Converts grams of protein, carbohydrate, fat and alcohol into kilocalories and kilojoules with the Atwater general factors (4 / 4 / 9 / 7 kcal per gram) and reports each macronutrient's share of total energy.","use_when":"You have the macronutrient grams of a food, meal or daily intake and need total calories or the percentage split, e.g. to check a food label or diet plan.","do_not_use_when":"You want to go the other way, from a calorie target to gram targets (use macros), or need calorie needs (use tdee).","inputs":[{"name":"protein_g","label":"Protein","type":"number","unit":"g","required":true,"min":0,"max":5000,"description":"Protein in grams.","example":30},{"name":"carbs_g","label":"Carbohydrate","type":"number","unit":"g","required":true,"min":0,"max":5000,"description":"Total carbohydrate in grams, including any fibre.","example":40},{"name":"fat_g","label":"Fat","type":"number","unit":"g","required":true,"min":0,"max":5000,"description":"Fat in grams.","example":10},{"name":"alcohol_g","label":"Alcohol","type":"number","unit":"g","required":false,"default":0,"min":0,"max":1000,"description":"Ethanol in grams (a 330 ml 5 % beer contains about 13 g).","example":0},{"name":"fiber_g","label":"Dietary fibre","type":"number","unit":"g","required":false,"min":0,"max":1000,"description":"Optional fibre included in carbs_g; counted at 2 kcal/g (EU labelling factor) instead of 4 kcal/g.","example":5}],"outputs":[{"name":"calories_kcal","label":"Total energy","type":"number","unit":"kcal","decimals":0,"description":"Sum of all macronutrient energy."},{"name":"energy_kj","label":"Total energy","type":"number","unit":"kJ","decimals":0,"description":"Total energy in kilojoules (× 4.184)."},{"name":"protein_kcal","label":"Protein energy","type":"number","unit":"kcal","decimals":0,"description":"protein_g × 4."},{"name":"carbs_kcal","label":"Carbohydrate energy","type":"number","unit":"kcal","decimals":0,"description":"(carbs_g − fiber_g) × 4 + fiber_g × 2."},{"name":"fat_kcal","label":"Fat energy","type":"number","unit":"kcal","decimals":0,"description":"fat_g × 9."},{"name":"alcohol_kcal","label":"Alcohol energy","type":"number","unit":"kcal","decimals":0,"description":"alcohol_g × 7."},{"name":"protein_percent","label":"Protein share","type":"number","unit":"%","decimals":1,"description":"Protein energy as a percentage of total energy."},{"name":"carbs_percent","label":"Carbohydrate share","type":"number","unit":"%","decimals":1,"description":"Carbohydrate energy as a percentage of total energy."},{"name":"fat_percent","label":"Fat share","type":"number","unit":"%","decimals":1,"description":"Fat energy as a percentage of total energy."},{"name":"alcohol_percent","label":"Alcohol share","type":"number","unit":"%","decimals":1,"description":"Alcohol energy as a percentage of total energy."}],"input_schema":{"type":"object","properties":{"protein_g":{"description":"Protein in grams. Unit: g.","type":"number","minimum":0,"maximum":5000,"examples":[30],"x-unit":"g"},"carbs_g":{"description":"Total carbohydrate in grams, including any fibre. Unit: g.","type":"number","minimum":0,"maximum":5000,"examples":[40],"x-unit":"g"},"fat_g":{"description":"Fat in grams. Unit: g.","type":"number","minimum":0,"maximum":5000,"examples":[10],"x-unit":"g"},"alcohol_g":{"description":"Ethanol in grams (a 330 ml 5 % beer contains about 13 g). Unit: g.","type":"number","minimum":0,"maximum":1000,"default":0,"examples":[0],"x-unit":"g"},"fiber_g":{"description":"Optional fibre included in carbs_g; counted at 2 kcal/g (EU labelling factor) instead of 4 kcal/g. Unit: g.","type":"number","minimum":0,"maximum":1000,"examples":[5],"x-unit":"g"}},"additionalProperties":false,"required":["protein_g","carbs_g","fat_g"]},"output_schema":{"type":"object","properties":{"calories_kcal":{"description":"Sum of all macronutrient energy. Unit: kcal.","type":"number","x-unit":"kcal"},"energy_kj":{"description":"Total energy in kilojoules (× 4.184). Unit: kJ.","type":"number","x-unit":"kJ"},"protein_kcal":{"description":"protein_g × 4. Unit: kcal.","type":"number","x-unit":"kcal"},"carbs_kcal":{"description":"(carbs_g − fiber_g) × 4 + fiber_g × 2. Unit: kcal.","type":"number","x-unit":"kcal"},"fat_kcal":{"description":"fat_g × 9. Unit: kcal.","type":"number","x-unit":"kcal"},"alcohol_kcal":{"description":"alcohol_g × 7. Unit: kcal.","type":"number","x-unit":"kcal"},"protein_percent":{"description":"Protein energy as a percentage of total energy. Unit: %.","type":"number","x-unit":"%"},"carbs_percent":{"description":"Carbohydrate energy as a percentage of total energy. Unit: %.","type":"number","x-unit":"%"},"fat_percent":{"description":"Fat energy as a percentage of total energy. Unit: %.","type":"number","x-unit":"%"},"alcohol_percent":{"description":"Alcohol energy as a percentage of total energy. Unit: %.","type":"number","x-unit":"%"}}},"formula":"kcal = 4·protein_g + 4·(carbs_g − fiber_g) + 2·fiber_g + 9·fat_g + 7·alcohol_g; percent_x = kcal_x / kcal × 100; kJ = kcal × 4.184","method":"Atwater general factors are averages of metabolisable energy; label values can differ by a few percent because manufacturers may use specific factors, and US labels may count insoluble fibre at 0 kcal/g.","sources":[{"name":"FAO (2003) Food energy – methods of analysis and conversion factors (Atwater general factors)","url":"https://www.fao.org/4/y5022e/y5022e00.htm","type":"standard","retrieved_at":"2026-09-24"},{"name":"Regulation (EU) No 1169/2011 Annex XIV – energy conversion factors (fibre 2 kcal/g, alcohol 7 kcal/g)","url":"https://eur-lex.europa.eu/eli/reg/2011/1169/oj","type":"standard","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"30 g protein, 40 g carbs, 10 g fat","inputs":{"protein_g":30,"carbs_g":40,"fat_g":10},"expected":{"calories_kcal":370,"energy_kj":1548,"protein_kcal":120,"carbs_kcal":160,"fat_kcal":90,"protein_percent":32.4,"carbs_percent":43.2,"fat_percent":24.3,"alcohol_percent":0},"url":"https://tttkmbb.com/api/v1/calculate/calories-from-macros?protein_g=30&carbs_g=40&fat_g=10"},{"name":"25 / 50 / 15 g plus 14 g alcohol","inputs":{"protein_g":25,"carbs_g":50,"fat_g":15,"alcohol_g":14},"expected":{"calories_kcal":533,"alcohol_kcal":98,"alcohol_percent":18.4,"carbs_percent":37.5},"url":"https://tttkmbb.com/api/v1/calculate/calories-from-macros?protein_g=25&carbs_g=50&fat_g=15&alcohol_g=14"}],"faq":[{"q":"Why does the label show fewer calories than this?","a":"Labels may subtract insoluble fibre entirely (US) or use specific Atwater factors for the food; rounding rules also allow small differences."},{"q":"Does 'net carbs' apply here?","a":"Only via fiber_g: fibre is counted at 2 kcal/g. Sugar alcohols are not handled separately (they average about 2.4 kcal/g)."}],"tags":["calories from macros","macro calories","atwater factors","protein carbs fat calories","macronutrient percentages"],"related":[{"calculator_id":"macros","reason":"Reverse direction: grams of each macro from a calorie target."},{"calculator_id":"tdee","reason":"Compare the intake with daily energy needs."}],"links":{"html":"https://tttkmbb.com/food/calories-from-macros","markdown":"https://tttkmbb.com/food/calories-from-macros.md","json":"https://tttkmbb.com/food/calories-from-macros.json","api":"https://tttkmbb.com/api/v1/calculate/calories-from-macros","schema":"https://tttkmbb.com/api/v1/calculators/calories-from-macros","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-23T23:35:18Z"}