How to Save Onion Seeds
Most bulb onions (Allium cepa) flower in their second growing season after winter. Insects can transfer pollen between compatible onion varieties.

Black onion seeds after cleaning. Photo by Hamza DK, CC BY-SA 4.0.
Select and overwinter bulbs
Choose a generous group of healthy, true-to-type bulbs with good keeping quality. Discard damaged or rotting bulbs. Leave them in the ground where winters and drainage permit, or store them appropriately and replant in spring.
Harvest and test
Cut flower heads when many capsules begin to open and black seeds are visible, before substantial shedding. Dry under cover over a clean tray or paper bag, then thresh gently. Label the harvest and store cool and dry. Onion seeds are relatively short-lived, so test germination before sowing.