Carb Counter Formula

Understand the math behind the carb counter. Each variable explained with a worked example.

Formulas Used

Total Carbs

carbs_g = food_weight_g * carb_pct / 100

Calories from Carbs

calories_from_carbs = (food_weight_g * carb_pct / 100) * 4

% of 300 g Daily Target

pct_daily_300g = (food_weight_g * carb_pct / 100) / 300 * 100

Variables

VariableDescriptionDefault
food_weight_gFood Weight(g)200
carb_pctCarb Content28

How It Works

How to Count Carbs

Formula

Carbs (g) = Food Weight (g) x Carb Percentage / 100

Carb Content of Common Foods (cooked)

  • Rice: 28 g per 100 g
  • Pasta: 25 g per 100 g
  • Potato: 20 g per 100 g
  • Bread: 49 g per 100 g
  • Oats (dry): 76 g per 100 g
  • Worked Example

    Count carbs in 200 g of cooked rice.

    food_weight_g = 200carb_pct = 28
    1. 01Cooked rice carb content: 28 g per 100 g.
    2. 02Carbs: 200 x 28/100 = 56 g.
    3. 03Calories from carbs: 56 x 4 = 224 kcal.

    Ready to run the numbers?

    Open Carb Counter