Chlorine is made inside supernovae, or massive stars that explode at the end of their lives. Chlorine is created through the r-process, or rapid neutron capture. On Earth, chlorine can be obtained from saltwater through electrolysis. Chlorine, in the form of chloride, can also be found in meteorites.
Chlorine can also be separated from hydrochloric acid by the action of manganese dioxide. This is how the Swedish chemist Carl Wilhelm Scheele discovered chlorine in 1774.
Chlorine is a halogen and is so reactive that it's almost never found in its free state on Earth. At standard temperature and pressure, chlorine is a poisonous, pale yellow green gas. It has a pungent smell, irritates mucous membranes and burns skin.
However, when chlorine is combined with other elements, it can be stable and quite useful. This can be seen when it combines with sodium to make table salt and with potassium to make sylvite. Even hydrochloric acid found in gastric juice is important for proper digestion in humans. The acid not only helps to break down nutrients, but is necessary for the absorption of vitamin B12.
Also, when chlorine is diluted, it is an excellent bleaching and disinfecting agent. It also goes into the manufacture of polyvinyl chloride and plastics.