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.

    Frequently Asked Questions

    What is the difference between total carbs and net carbs?

    Net carbs = total carbs minus fiber (and sometimes sugar alcohols). Fiber is not digested for energy, so some diets subtract it.

    How many carbs per day?

    The DRI recommends 45-65% of calories from carbs. On a 2000 kcal diet, that is 225-325 g. Low-carb diets may target under 100 g.

    Are all carbs the same?

    No. Complex carbs (whole grains, vegetables) digest slowly and provide sustained energy. Simple carbs (sugar, white flour) digest quickly and spike blood sugar.

    Ready to run the numbers?

    Open Carb Counter