The series of events required for an organism to receive a chemical stimulus relating to a magnetic field, convert it to a molecular signal, and recognize and characterize the signal. It is believed that organisms such as birds and salamanders use a 'chemical compass': chemical reactions that involve transitions between different spin states can be influenced by magnetic fields and by detecting the different product ratios, these organisms can perceive the direction of the magnetic field. The mechanism by which this is detected is not certain but it may also involve light stimuli.