According to one embodiment, a pressure sensor includes a film portion, a sensor unit, and a structure body. The film portion has a front surface and is deformable. The sensor unit includes a plurality of sensing elements arranged along the front surface. One of the plurality of sensing elements includes a magnetic layer, a opposing magnetic layer, and a nonmagnetic intermediate layer. The structure body is arranged with the first sensor unit along the arrangement direction of the plurality of sensing elements. The structure body includes a structure body layer, a opposing structure body layer, and a intermediate structure body layer. The structure body layer has at least one of a floating potential with respect to the opposing structure body layer or same potential as a potential of the opposing structure body layer.