To provide a magnetic sensor capable of having high spatial resolution.SOLUTION: The gas analyzing apparatus includes a subject arranging section for placing a subject, a gas cell accommodating section for accommodating a plurality of gas cells arranged two-dimensionally, a gas cell accommodating section for allowing light to enter the gas cell, a plurality of two-A polarization separating element for separating the light transmitted through the gas cell into a first polarized light and a second polarized light and a photodetector for detecting the first polarized light or the second polarized light, And a plurality of arranged polarimeters, wherein the gas cell houses a medium that changes the optical characteristics of light according to the magnitude of the magnetic field, and the gas cell accommodating section accommodates the subject placement section and the plurality of the above-A plurality of the optical prisms are provided between the gas cell housing portion and the plurality of the polarimeters, and the polarimeter changes the polarization direction of the incident light in the polarization separation device It is configured to be possible , The magnetic sensor.(FIG.【課題】高い空間分解能を有することができる磁気センサーを提供する。【解決手段】被検体を配置する被検体配置部と、2次元的に配置された複数のガスセルを収容するガスセル収容部と、前記ガスセルに光を入射させ、2次元的に配置された複数の光学プリズムと、前記ガスセルを透過した光を第1偏光と第2偏光とに分離させる偏光分離素子、および前記第1偏光または前記第2偏光を検出する光検出器を有し、2次元的に配置された複数の偏光計と、を含み、前記ガスセルは、磁場の大きさに応じて光の光学特性を変化させる媒体を収容し、前記ガスセル収容部は、前記被検体配置部と複数の前記光学プリズムとの間に設けられ、複数の前記光学プリズムは、前記ガスセル収容部と複数の前記偏光計との間に設けられ、前記偏光計は、前記偏光分離素子における入射光の偏光方向を変更可能に構成されている、磁気センサー。【選択図】図3