Because of its commercial availability and long shelf-life, bromine is not typically prepared. Small amounts of bromine can however be generated through the reaction of solid sodium bromide with concentrated sulfuric acid (H2SO4). The first stage is formation of hydrogen bromide (HBr), which is a gas, but under the reaction conditions some of the HBr is oxidized further by the sulfuric acid to form bromine (Br2) and sulfur dioxide (SO2).
NaBr (s) + H2SO4 (aq) → HBr (aq) + NaHSO4 (aq)
2 HBr (aq) + H2SO4 (aq) → Br2 (g) + SO2 (g) + 2 H2O (l)
Similar alternatives, such as the use of dilute hydrochloric acid with sodium hypochlorite, are also available. The most important thing is that the anion of the acid (in the above examples, sulfate and chloride, respectively) be more electronegative than bromine, allowing the substitution reaction to occur.