In this article
Editorial update: September 29, 2026. Text prepared with AI support from the indicated sources. No independent clinical review. General information, not an individual meal plan.
Short answer
Yes. The Harvard Nutrition Source includes onion among the vegetables that typically fit into a ketogenic diet. Just know it has more carbs than leafy greens: 8.9 g per 100 g, versus 1.7 g for curly lettuce.
How many carbs does onion have?
| Food | Total carbohydrate (g) | Fiber (g) |
|---|---|---|
| Onion, raw | 8.9 | 2.2 |
| Garlic, raw | 23.9 | 4.3 |
| Curly lettuce, raw | 1.7 | 1.8 |
| Broccoli, raw | 4.0 | 2.9 |
In 20 g of raw onion, for example, there are about 1.8 g of carbohydrate; in 100 g, 8.9 g, equivalent to 18% of a daily limit of 50 g.
How to fit onion into your day
As a seasoning, in small amounts, onion adds little to the day’s count; when it becomes the base of a dish, the quantity increases and so does the count. Garlic, also on the Harvard list, has 23.9 g per 100 g, but 5 g of raw garlic have about 1.2 g. The vegetable table helps compare with other vegetables.
If you have diabetes or another condition, take medication, are pregnant or breastfeeding, talk to a doctor or dietitian before changing your diet. Precautions before starting are at risks and cautions of the ketogenic diet.
Sources
- Harvard T.H. Chan School of Public Health, The Nutrition Source: Diet Review: Ketogenic Diet for Weight Loss
- TACO – Brazilian Food Composition Table, 4th revised and expanded edition (NEPA/Unicamp)

Mariana is passionate about a healthy lifestyle.





