Calculating carbs on keto comes down to one core concept: net carbs. Net carbs are the carbohydrates your body actually absorbs and uses for energy, and most people need to stay under 20 to 50 grams of net carbs per day to maintain ketosis. The math itself is simple, but a few details around sugar alcohols and food labels can trip you up if you’re not aware of them.
The Net Carb Formula
For any food, the basic equation is:
Net Carbs = Total Carbohydrates − Fiber − Sugar Alcohols
You subtract fiber because your body can’t digest it. It passes through without raising blood sugar. Sugar alcohols (common in keto-friendly packaged foods) are also partially or fully indigestible, so they get subtracted too, though with an important caveat covered below.
A quick example: if a food has 20 grams of total carbs, 10 grams of fiber, and 5 grams of sugar alcohols, you’d subtract both from the total to get 5 grams of net carbs. Those 5 grams are what you count toward your daily limit.
How Many Net Carbs to Stay in Ketosis
Most people aim for 20 to 50 grams of net carbs per day on a ketogenic diet. Harvard’s School of Public Health notes that the standard ketogenic diet keeps total carbohydrate intake below 50 grams daily, and many people start at 20 grams to enter ketosis faster. For reference, 50 grams of total carbs is less than what’s in a single plain bagel.
Where you fall in that 20 to 50 range depends on your activity level, metabolism, and goals. If you’re just starting keto, beginning at 20 grams of net carbs per day for the first few weeks gives you the widest margin for error. Once you’re reliably in ketosis (which you can verify with urine strips or a blood ketone meter), you can experiment with slowly increasing carbs to find your personal threshold.
The Sugar Alcohol Exception
Not all sugar alcohols are created equal, and this is where many keto calculators oversimplify things. The general rule from the UCSF Diabetes Teaching Center is to subtract only half the grams of sugar alcohol from total carbohydrates, not the full amount. That’s because most sugar alcohols are partially absorbed and do have some effect on blood sugar.
Here’s how that looks in practice: if a protein bar lists 29 grams of total carbohydrates and 18 grams of sugar alcohol, you’d divide the sugar alcohol in half (9 grams) and subtract that from the total. The result is 20 grams of net carbs, not the 11 grams you’d get if you subtracted all 18.
The one major exception is erythritol. It has essentially zero glycemic impact and is excreted by the body almost entirely unchanged. If a nutrition label specifies erythritol as the sugar alcohol, you can subtract the full amount. Maltitol, sorbitol, and xylitol, on the other hand, do raise blood sugar to varying degrees, so the half-subtraction rule applies to those.
Calculating Carbs in Whole Foods
Packaged foods make things relatively easy because the nutrition label gives you total carbs, fiber, and sugar alcohols in one place. Whole foods like vegetables, nuts, and berries require a quick lookup, but the math is actually simpler since there are no sugar alcohols to worry about. You just subtract fiber from total carbs.
A cup of raw broccoli, for instance, has about 6 grams of total carbs and 2.4 grams of fiber, giving you roughly 3.6 grams of net carbs. A cup of raw spinach has about 1.1 grams of total carbs and 0.7 grams of fiber, so less than half a gram of net carbs. Leafy greens and cruciferous vegetables are consistently the lowest-carb options.
For reliable numbers, the USDA’s FoodData Central database provides complete nutrition breakdowns for thousands of whole foods. A quick search for any vegetable, fruit, or nut will give you the total carbs and fiber you need to do the subtraction yourself.
Reading Keto Product Labels Carefully
Many keto-branded products already display a “net carbs” count on the front of the package, but this number isn’t regulated by the FDA. Manufacturers calculate it themselves, and they sometimes subtract sugar alcohols in full even when the half-subtraction rule would be more accurate. Always check the Nutrition Facts panel on the back and do the math yourself.
One newer ingredient to watch for is allulose, a rare sugar that’s increasingly popular in keto products. The FDA has issued guidance allowing manufacturers to exclude allulose from “Total Sugars” and “Added Sugars” on nutrition labels, recognizing that it contributes minimal calories (roughly 0.4 calories per gram compared to 4 for regular sugar) and has negligible effects on blood sugar. Some manufacturers already exclude allulose from total carbohydrates on their labels, while others still include it. If you see allulose listed in the ingredients but your carb count looks high, check whether it’s been included in the total carbohydrate line. If it has, you can subtract it entirely.
Putting It Into Practice
The easiest way to track your daily net carbs is to pick one method and stay consistent. Many people use an app like Cronometer or MyFitnessPal, which can be set to display net carbs automatically. If you prefer manual tracking, keep a running tally throughout the day. A simple notes app works fine.
For each food, follow this decision tree:
- Whole food (no label): Look up total carbs and fiber in the USDA database. Subtract fiber from total carbs.
- Packaged food with fiber only: Subtract all fiber from total carbs on the label.
- Packaged food with erythritol: Subtract all fiber and all erythritol from total carbs.
- Packaged food with other sugar alcohols (maltitol, sorbitol, xylitol): Subtract all fiber and half the sugar alcohols from total carbs.
- Packaged food with allulose: If allulose is included in total carbs, subtract it entirely along with fiber.
One common mistake is ignoring small carb counts that add up. A splash of cream in your coffee, a handful of nuts, a few cherry tomatoes in your salad. Individually these might be 1 to 3 grams of net carbs, but four or five of these “invisible” additions can account for half your daily budget if you’re aiming for 20 grams. Tracking everything, even the small stuff, matters most during your first few weeks until you develop an intuitive sense for portion sizes and carb counts.

