Onion is not considered keto-friendly, but can still be used in small amounts for flavoring.
Used as a base ingredient and flavoring in many recipes such as soup. The delicious flavor of caramelized onions are a result of the maillard reaction, a chemical action between the complex sugars and amino acids which causes browning in foods.
Small onion, sauteed contains 4.3 gram net carbs.
Small onion, raw contains 5.34 gram net carbs.
Onion is generally considered not suitable for the ketogenic diet due to its high sugar content, but is perfectly okay in the correct amounts. As seen above a small onion, sauteed is 4.3 gram net carbs which fits well with the general limits of 25 grams to 50 grams to stay in ketosis.
Onion powder, 1tbsp (7g) contains 4.46 gram net carbs.
Onion powder, 1tsp (2g) contains 1.5 gram net carbs.
Spring Onion, 1 large (25g) contains 1.14 gram net carbs.
Celery, 1 large stalk (64g) contains 0.9 gram net carbs.
One option, although not necessarily lower carb is using onion powder. Since it is more concentrated due to being dehydrated, you can get a lot more flavor out of less. Many recipes can use as little as 1 teaspoon which is only 1.5g net carbs.
Spring onions are also a great substitute especially for asian dishes. It has a strong flavor, so a small amount goes a long way, while being lower carbs than onions.
Another option is using celery. While its flavor is quite different, it has a very aromatic flavor, while having the advantage of being much lower carbs than onions and even spring onions.
When your goal is weight loss, minimizing or simply not eating any carbs or sugars will help maximize fat loss as your body will focus on utilizing fat and spare glucose for vital functions in the body. So in this case, we would skip the onions if possible or just have a small amount for flavoring or use a substitute like celery which has so little carb that you won’t have to worry about it.
People that exercise on a ketogenic diet generally have more leeway when it comes to eating carbohydrates. On days that are sedentary and with low activity should stay below 25 grams net carbs a day. On workout days, especially at higher intensity, people report being able to have up to 100 grams net carbs while comfortably staying in ketosis especially with a fat adapted metabolism.