Here's how fluorine is extracted from fluorspar:
1. Extraction: Fluorspar is mined and crushed into a powder.
2. Reaction with sulfuric acid: The fluorspar powder is reacted with concentrated sulfuric acid (H2SO4) at high temperatures. This process generates hydrogen fluoride (HF) gas:
```
CaF2 + H2SO4 → CaSO4 + 2HF
```
3. Purification: The hydrogen fluoride gas is purified by removing impurities like water and other acidic gases.
4. Electrolysis: The purified hydrogen fluoride gas is then electrolyzed in a cell with a special electrolyte, usually potassium bifluoride (KHF2), at high temperatures. This process separates fluorine gas (F2) from the hydrogen fluoride:
```
2HF → H2 + F2
```
The fluorine gas produced is highly reactive and dangerous, requiring careful handling and storage.