To calculate net carbs, subtract the fiber grams from the total carbohydrates in food. For example, if a food has 10 grams of carbohydrates and 4 grams of fiber, the net carbs would be 6 grams (10g - 4g = 6g).