Yes, raw onion scraps and papery skins can go into an ordinary backyard compost bin. Mix them with other suitable material and cover them with dry browns. Onion skins do not need peeling off and discarding first. For an indoor worm bin, the simpler choice is to leave onions out.
Add small pieces to a mixed outdoor pile
Separate onion scraps from stickers, bags and other packaging. Cut a whole unwanted onion into smaller pieces so it is easier to mix. There is no need to grind it into a paste: a wet onion layer is harder to aerate than small pieces distributed through the pile.
Mix scraps with leaves, plain shredded cardboard and other suitable compost ingredients. Cover fresh food and secure the bin against pests. A pile made mainly of onions is a different management problem from a few trimmings after dinner.
If you have a large spoiled batch, add it gradually only if your system has capacity, or check whether a local collection service accepts it. Do not overload a small bin to avoid putting anything in the trash.
What about cooked onions?
Consider what came with them. Onions mixed with meat, cheese, oil or rich sauce are unsuitable for a basic backyard system that excludes those ingredients. A local food-scrap service may accept them, but check its rules rather than assuming all composting methods take the same foods.
The EPA home-composting guide distinguishes backyard inputs from worm-bin feeding. Use the rules for your actual system, not a blanket statement that anything biodegradable is suitable.
Leave onions out of a beginner worm bin
EPA recommends avoiding odorous foods such as onions and garlic in worm composting. There are plenty of other suitable vegetable scraps to feed your worms. You do not need to experiment with onion quantities to keep the bin productive.
For more on choosing between worms, an outdoor bin and a collection service, see urban composting options.
Address smell by checking conditions
A strong odor is a reason to inspect the mixture, moisture and exposed scraps. In an aerobic outdoor pile, add dry material and loosen a compacted mixture when needed. Keep fresh food covered. Do not rely on crushed oyster shells to neutralize a management problem.
No ingredient or chopping method makes a bin pest-proof. Look for gaps, damaged lids and accessible scraps as well as the contents themselves.
Wait for the whole batch to finish
There is no separate one-month curing rule that makes onion compost ready. Decomposition depends on the mixture and conditions, and recognizable skins may persist longer than soft pieces. Judge the finished batch by its stable, crumbly, earthy character; return unfinished pieces to the bin.
Onions contribute organic material to a mixed compost. They do not turn it into a special pesticide or a complete fertilizer. Use mature compost according to the needs of the soil and plants.