Magnesium is a constituent of chlorophyll. Chlorophylls are the green photosynthetic pigments. Five types of chlorophylls $a, b, c, d$ and $e$ occur in plants. Out of these only chlorophylls a and b occur in the chloroplasts of higher plants. Molecular formula of chlorophyll $a, b, c$ and $d$ are $C_{55}H_{72}O_{5}N_{4}\,Mg, C_{55}H_{70}O_{6}N_{4}\,Mg, C_{35}H_{32}O_{5}N_{4}\,Mg$ and $C_{54}H_{70}O_{6}N_{4}\,Mg$ respectively. Chlorophyll $e$ is a rare type found in some golden algae.