A magnetic field generator includes a magnetic circuit of an open magnetic
path in which a uniform magnetic field can be generated with a simpler
structure. A nuclear magnetic resonance device equipped with this
magnetic filed generator is also provided. The magnetic field generator
of an open magnetic path type includes: a first permanent magnet and a
second permanent magnet which are arranged sequentially in a reference
direction with a predetermined distance therebetween while directing the
direction of magnetization in the reference direction, and a third
permanent magnet and a fourth permanent magnet which are arranged
sequentially between the first permanent magnet and the second permanent
magnet along the reference direction while being in contact with each
other or being spaced apart from each other with a predetermined distance
therebetween. The direction of magnetization of the third permanent
magnet has a first component parallel to the reference direction and a
second component intersecting a first direction orthogonally and directed
toward the region side. The direction of magnetization of the fourth
permanent magnet has a first component and an inverted second component
opposite to the direction of the second component and having a magnitude
equal to a magnitude of the second component.