Onions lined up on dirt with sprouts sticking out of them
Is It Safe To Eat Onions That Have Started Sprouting?
An onion sprouting isn’t a sign of spoilage, so a sprouting onion is still fine to eat. Green or black mold or dark squishy spots are signs of actual spoilage.
A sprouted onion may taste bitter if eaten raw, but it’ll likely taste normal if it’s cooked. You don't need to discard the sprout either, which is basically a bonus green onion.
To avoid sprouting for as long as possible, you can look for fresher onions. Fresh onions are recognizable by their lighter skin, which has fewer papery layers.
To slow down any possible sprouting, store your onions at room temperature out of direct sunlight. Bright light and moisture get the growth cycle going.