You can use onion salt to add a mild onion flavor along with salt. It is perfect for breads, dry rubs and salad dressings where you may want onion and salt without the bulk of fresh onion. It is versatile enough that you should keep some in your spice cabinet, but there are several onion salt alternatives if you run out.
Your best bet: Onion powder and salt
Onion salt is simply a blend of onion powder and salt with an anti-caking agent that does not affect the flavor. By combining the two ingredients, you are making your own onion salt that should be similar or identical to prepackaged onion salt.
Note that spice makers will have their own proportions of each ingredient. If you want to replicate a particular commercial blend, start with equal parts onion powder and salt and play with the balance between the two until you find the combination that is the closest match.
Making your own onion salt offers you a higher degree of flexibility that you would get with premade onion salt. You can add as much or as little as you want of each seasoning. Your homemade onion salt will have the same texture as the onion salt that you get from the grocery store and can be used in the same way.
A decent second choice: Grated fresh onion and salt
Fresh onion and salt can provide you with a flavor that is similar to the flavor of the onion powder in onion salt. As with the homemade onion salt blend above, you get to control the balance of flavors in this mixture. Finely grate the onion to more closely replicate the texture of onion powder. Note that when finely grated, the fresh onion will still have some bulk so this substitute may not be ideal for dishes like thin soups or smooth salad dressings. Fresh onion will also add moisture to your dish; if you are adding a lot of it, you may have to adjust other liquids to compensate.
It is also important to remember that the flavor of fresh onion is stronger than the flavor of the onion powder in onion salt so you should use less of it. Start by grating a quarter of a medium-sized onion and combining it with a 1/2 teaspoon of salt for every teaspoon of onion salt that your recipe requires.
In a pinch: Dehydrated onion flakes and salt
Onion powder and onion flakes are both made from dehydrated onion. The difference between the two spices has to do with their textures.
When using onion flakes to replace onion salt, you have two options: use them in your recipe as-is and combined with salt, or grind them to make onion powder that you can use to make onion salt. Grinding is preferable if you are making a dry rub for meat or a thin soup. When using whole flakes use 1/2 teaspoon of whole onion flakes and a 1/2 teaspoon of salt for every teaspoon of onion salt that your recipe requires.
Combine onion juice and salt to get the flavor of onion salt without the bulk that comes with fresh onion or onion flakes. Since onion juice is a liquid, you may need to adjust other liquids in the dish to compensate.
Celery salt offers some of the savory notes that you want from onion along with salt. You can use it exactly as you would onion salt.