According to one embodiment, a magnetic sensor includes a detection section including first to fourth shields, a first magnetic member, first to fourth conductive members being non-magnetic. A second direction from the third shield to the fourth shield crosses a first direction from the first shield to the second shield. The first magnetic member is provided between the first shield and the second shield and between the third shield and the fourth shield. The first to fourth conductive members, satisfy one of first to fourth conditions regarding first to third materials. The first material includes at least one selected from the group consisting of Nb, Mo, Tc, Ta, W, and Re. The second material includes at least one selected from the group consisting of Ru, Rh, Pd, Os, Ir, and Pt. The third material includes at least one selected from the group consisting of Cu, Al, Tb, and Cr.