PROBLEM TO BE SOLVED: To provide a sensor capable of improving sensitivity, and a microphone.SOLUTION: According to an embodiment, a sensor includes: a printed-circuit board a cover a support part provided between the printed-circuit board and the cover a deformable substrate supported by the support part between the printed-circuit board and the cover and a detection element provided on the substrate between the printed-circuit board and the cover. The detection element includes a first magnetic layer, a second magnetic layer containing Fe1-yBy(0