Macros Per Recipe Calculator Formula

Understand the math behind the macros per recipe calculator. Each variable explained with a worked example.

Formulas Used

Calories Per Serving

cal_per_serving = total_cal / servings

Protein Per Serving

protein_per = total_protein_g / servings

Carbs Per Serving

carbs_per = total_carbs_g / servings

Fat Per Serving

fat_per = total_fat_g / servings

Total Recipe Calories

total_calories = total_cal

Variables

VariableDescriptionDefault
total_protein_gTotal Protein(g)80
total_carbs_gTotal Carbs(g)120
total_fat_gTotal Fat(g)60
servingsServings4
total_calTotal calories= total_protein_g * 4 + total_carbs_g * 4 + total_fat_g * 9calculated

How It Works

How to Calculate Macros Per Recipe

Formulas

Total Calories = (Protein x 4) + (Carbs x 4) + (Fat x 9)

Per Serving = Total / Number of Servings

Calorie Values

  • 1 g protein = 4 kcal
  • 1 g carbohydrate = 4 kcal
  • 1 g fat = 9 kcal
  • Worked Example

    A recipe has 80 g protein, 120 g carbs, 60 g fat, and serves 4.

    total_protein_g = 80total_carbs_g = 120total_fat_g = 60servings = 4
    1. 01Total calories: (80 x 4) + (120 x 4) + (60 x 9) = 320 + 480 + 540 = 1340 kcal.
    2. 02Per serving: 1340 / 4 = 335 kcal.
    3. 03Protein: 80 / 4 = 20 g per serving.
    4. 04Carbs: 120 / 4 = 30 g per serving.
    5. 05Fat: 60 / 4 = 15 g per serving.

    Ready to run the numbers?

    Open Macros Per Recipe Calculator