The blessing over onions:
Raw: The blessing over raw onions is Hadama. This applies even if one is eating it plain [without a dip]. This applies even in areas that people abstain from eating raw onions plain, and only eat it together with other foods, such as bread or in a salad, nevertheless the blessing of Hadama is recited upon eating it plain. [However, whenever the onion is eaten with another food, then the regular rules of Ikur and Tafel apply, and only one blessing is recited on the Ikkur. The above ruling follows the opinion of Admur, however many are accustomed to reciting the blessing of Shehakol on raw onions, as rule other opinions. Nonetheless, even according to their opinion, one who said Hadamah on raw onions is Yotzei.]
Per the rulings of Admur, raw [and fried] onions are Hadama. Cooked onions are Shehakol. Other Poskim, however, rule that even raw onions are Shehakol, although Bedieved one fulfills his obligation if Hadama was said.
 Seder 6:12; Luach 9:11-12; Admur 205:1-2; Ketzos Hashulchan 51:3; Luach Rav Elyashvili; Luach in end of Seder Birchas Hanehnin in English; Luach of Rav Prus; See Piskeiy Teshuvos 202:35; Article of Rav Chaim Rapapaort, printed in Koveitz Hearos Ubiurim Ohalei Torah
Other opinions: Some Poskim rule that today, being people no longer eat raw onions without bread, the blessing over raw onions is Shehakol, and they likewise rule that cooked onions are Shehakol [See Poskim below] Nonetheless, even accoridng to their opinion, Bedieved one who says Hadama is Yotzei. [See Rav Akiva Eiger 475 on M”A 475:10 that one is Yotzei Bedieved if he said a Hadama on a vegetable that is Shehakol when eaten raw.]
 Admur Seder ibid, Luach 9:11, and 205:1 [in parentheses], “Even vegetables of which majority of people are not accustomed to eat raw, but rather with bread or another food, such as onions and the like, one recites a blessing of Borei Peri Hadama upon eating them when they are raw.”; Chok Yaakov 475:16 regarding horseradish and the same would apply to onions; Ketzos Hashulchan ibid; Michaber 205:1 regarding raw garlic; Luach Rav Elyashvili; Luach in end of Seder Birchas Hanehnin in English; Luach of Rav Prus; Hearos of Rav Mordechai Eliyahu in Sefer Vezos Haberacha p. 361 “a raw onion that is not sharp is Hadama”; So is understood from all the following Poskim who mention using onions for Karpas, which must be a Hadama vegetable: Aruch Hashulchan 473:10 in 1st option; Misgeres Hashulchan 118:1; Yesod Veshoresh Havoda 9:4; Chayeh Adam 130:5 [unlike Binas Adam 51:1]; Implication of Elya Raba 473:27 who only negates onions due to bad breath [However, see Chok Yaakov 475:16 and Ritva Seder Hagadah that even raw Shehakol vegetables used for Karpas get elevated to Hadama]
Very sharp onions: Garlic and onions which are very old and are thereby not fit to be eaten without bread due to their great sharpness, receive the blessing of Shehakol. [Admur 205:1; Luach 9:11; Taz 205:2] Omitted from Admur in Seder ibid, Vetzaruch Iyun as to the reason; See Seder ibid of Rav Elyashvili footnote 74 that perhaps here Admur holds that even very sharp onions are Hadama when eaten with another food; However, see Kaf Hachaim 205:9 that if they are very sharp they do not receive a blessing
Other opinions: Some Poskim rule that today, being people no longer eat raw onions without bread, the blessing over raw onions is Shehakol. [Shaareiy Teshuvah 205:3 concludes like Bach 205 to say Shehakol on raw onions; Binas Adam 51:1; M”B 205:5 based on Shaareiy Teshuvah and Binas Adam, and conclusion of Shaar Hatziyon 205:7 based on implication of M”A 475:10; Kaf Hachaim 205:9; Igros Moshe O.C. 1:64 “The directive is to say Shehakol on raw garlic and onions”; However, see Igros Moshe 1:62 regarding radishes that he suspects for the opinion of Admur and says it is best to eat it only with bread; Rav Wozner in Koveitz Mibeis Levi 17:51; Piskeiy Teshuvos 202:35; 205:2] Furthermore, some Poskim rule that the blessing of raw onions is Shehakol at all times [even when people would eat them raw]. [Implication of Bach 205, brought in M”A 205:3, regarding garlic; Tur 205 in name of Geonim regarding garlic] Nonetheless, even according to their opinion, Bedieved one who says Hadamah on raw onions is Yotzei. [See Rav Akiva Eiger 475 on M”A 475:10 that one is Yotzei Bedieved if he said a Hadamah on a vegetable that is Shehakol when eaten raw.]
Breslov tradition: To note, that in Breslov they have a tradition from the Baal Shem Tov to never eat raw onions whether plain or with other foods. [See Sichos Rebbe Nachman MiBreslov 265]
 The reason: Although all foods that are of better taste and quality when cooked rather than raw, receive the blessing of Hadama/Haeitz upon being cooked and the blessing of Shehakol upon being eaten raw, nevertheless, this only applies if majority of people are not accustomed to eating the food raw due to this reason. [Admur Seder 6:11; Luach 10:22; Admur 202:16; 205:1; Michaber 202:12; Tosafus Brachos 38b] If, however, the majority of people eat also the food when raw, such as species of vegetables and legumes, then even though the food is of better quality/taste when cooked, nevertheless one recites the proper blessing of Hadama/Haeitz whether it is eaten raw or cooked. [Admur Seder 6:12; Luach 9:10; 10:22; Admur 202:16; 205:1; M”A 205:3; however M”A 473:4 brings a dispute on this matter; Rashi Brachos 38b; Rabbeinu Yona Brachos 27a; P”M 205 A”A 3; Kaf Hachaim 202:88; 205:5] Now, this applies even if majority of people do not commonly eat the food alone in its raw state, but rather together with bread or another food [i.e. in salad], such as onions and the like [i.e. garlic], nonetheless one recites the blessing of Hadama over them. [Admur Seder ibid; Luach 9:11; 205:1 in parentheses; Chok Yaakov 475:16 regarding why horseradish is Hadama, as it is eaten with a dip, and the same would apply here regarding onions, as writes M”B in Shaar Hatziyon 205:7; See also M”B 203:14; See Shevet Halevi 10:125] However, this only applies if the food is still somewhat edible in its raw state and hence some people do eat the vegetable plain. However, if the food is completely inedible in its raw state, such as horseradish and the like, then no blessing is said over it even if it can be eaten together with other foods. [See Admur 475:23 and M”A 475:10 who says not to say a blessing on horseradish for this reason, and Chok Yaakov 475:16 who argues that one says Hadamah on raw horseradish being that it is eaten with other dips. Thus, in order to avoid a contradiction, we must conclude as above that according to Admur, there is a difference between a food that is edible in a time of ened, and a food that is not edible at all; See article of Rav Chaim Rappaport]
 Admur 205:1 in parentheses; Luach ibid
 See other opinions in previous footnotes!
 Rav Akiva Eiger 475 on M”A 475:10 that one is Yotzei Bedieved if he said a Hadama on a vegetable that is Shehakol when eaten raw, as it is nevertheless a food that grows from the ground
 Admur Seder ibid “However, over cooked onions one recites the blessing of Shehakol Nihyah Bidvaro.”; Luach 9:14; Admur 205:2; Michaber and Rama 205:1 regarding garlic; Brachos 38b regarding garlic; Tur 205; Rosh 6:15; Rabbeinu Yona Brachos 37a; Tosafus Brachos ibid; Bach 205; Shaareiy Teshuvah 205:3; M”B 205:5; Ketzos Hashulchan ibid; Igros Moshe 1:64; Rav Wozner in Koveitz Mibeis Levi 17:51; Az Nidbaru 13:36; Piskeiy Teshuvos 205:2; Luach Rav Elyashvili; Luach in end of Seder Birchas Hanehnin in English; Luach of Rav Prus;
Very sharp onions: Garlic and onions which are very old and are thereby not fit to be eaten without bread due to their great sharpness, receive the blessing of Hadama after they are cooked, even if they are cooked on their own. [Admur 205:1; Luach 9:12; Taz 205:2] Omitted from Admur in Seder ibid, Vetzaruch Iyun as to the reason; See Seder ibid of Rav Elyashvili footnote 75 that perhaps here Admur holds that even very sharp onions are Shehakol when cooked
Other opinions: Some Poskim rule that cooked onions are Hadama. [Kaf Hachaim 205:9; See Piskeiy Teshuvos 205:2 footnote 5 that perhaps they should be Hadama and hence concludes that one should eat a Sheakol and Hadama food to exempt it]
 The reason: As onions which are cooked independently become ruined [as their taste is no longer as good as it was when they were raw-Admur 205:2] [and they hence lose their advantageous Bracha]. [Furthermore, even if the onions are cooked with meat and hence become enhanced in taste and quality, nevertheless their blessing is demoted to Shehakol, as the meat or dish which enhanced them is the main food of the mixture, as their entire reason for the onions being cooked with the meat or dish is for the onions to give taste to the meat and dish, and not on the contrary for the meat and dish to give taste to the onions. [Admur Seder ibid; Luach ibid; Admur 205:2 “Their enhancement is not intrinsic…and the meat is the Ikkur”; Rama 205:1; Tur 205; Rosh 6:15; Rabbeinu Yona Brachos 37a; Tosafus Brachos ibid; M”A 205:5; Elya Raba 205:4]
 M”B 205:7; Piskeiy Teshuvos 205:2; See Admur 205:2 regarding nuts fried in honey that they are Haeitz being that the main intent is the nut and not the honey
The reason: As the onions become enhanced in their quality and taste when they are fried, and they become the main intent of the food. [M”B ibid] Vetzaruch Iyun regarding if one fried it for the sake of adding to another food, and not for the sake of eating plain.