Chlorine destroys microbes and so is used around the world to treat water to ensure it is safe to drink. It is the basis of many disinfectants and a key ingredient of the bleach you use to clean surfaces in your home and to purge any microbes from your toilet bowl.
It is also used to keep swimming pools free of bacteria, hence the distinctive smell. But here's something you probably didn't know, and if you are a regular swimmer, may not wish to know. That smell isn't chlorine, at least not the element. It is actually a chlorine compound called chloramine, which is created when chlorine combines with organic substances in the water. So what are those organic substances? We are talking about sweat and urine. So if you've ever noticed that the "chlorine" smell is stronger when the pool is full of kids, well now you know why.
BBC News website: Chlorine: From toxic chemical to household cleaner 19 April 2014