Onion seeds are not usually difficult to grow or to collect. The only thing to keep in mind is that onions are a biennial, meaning that they seed once every two years. By growing and saving your own onion seeds, you can develop a healthy reserve of seeds for next year’s garden, for eating directly, or for sprouting.
Plant onions, and leave them in the ground for two years. Watch for flowers and then seed heads to form during the late summer of the second season. You may wish to plant extra plants if you want onions to eat during the first season.
Wait for the seed heads to dry. Most of the flowers will be dry, and the seeds will begin to fall out on their own.
Cut the seed heads, or umbels, from the plants and allow them to dry completely.
Separate the seeds from the stems and other matter that makes up the seed head. Many seeds will fall out on their own. For the rest, place them in a bag, pound the whole bag against a hard surface. If you have many seeds, you may be able to use the wind to separate them from stems and other matter. Use a large bowl and toss them in the air, or pour them from one container to another in a light breeze. The wind should sift the lighter stems away and leave the heavier seeds to fall. There's no harm in having a little bit of stem or seed head in your seeds unless you are sprouting them. If you plant it along with the seeds, it will just decompose.
Store the seeds in a cool, dry place. Label the seeds with the year you saved them, or plant them immediately in a mild climate. Most seeds work best if they are used within one year of saving them, but you may get an acceptable germination rate the second year.