It is made by electrolysis (the passing of electricity through a solution to make chemical reactions happen) of sodium chloride. This is known as the chloralkali process. It can also be made by reacting hydrogen chloride with oxygen and a catalyst. It can be made in the laboratory by reacting manganese dioxide with hydrochloric acid. It is made when sodium hypochlorite reacts with hydrochloric acid. This is a dangerous reaction that can happen without anyone knowing.