Here's what to do when you are in a pinch.
Shallots are sweeter and milder than onions but otherwise very similar in flavor. We typically call for shallots in recipes where we want a more delicate onion flavor, such as in salad dressings and stir-together sauces. If you substitute onions for shallots in raw applications like these, the result will have a more pronounced and sharper oniony bite. Depending on your preference, you'll likely find the flavor to be out of balance and overly pungent. However, if you're in a pinch with no shallots on hand, you can tame the bite of raw onion by soaking it in ice water for 10 minutes.
In most cooked applications where chopped or sliced shallots are sautéed or roasted, substituting the same volume of onion should work fine, as long as you cut the onions into the same size pieces as you would the shallots. If you're sautéing, you can mellow out the onion a bit by simply cooking it a little longer before proceeding with the next step. Even if the alliums are being cooked, however, we don't recommend making this swap in recipes where shallots play a starring role, such as our Roasted Carrots and Shallots.