A magnetic sensor, comprising: a magnetoresistive element that is formed by stacking a magnetic layer and a non-magnetic layer on a substrate and that exhibits a magnetoresistive effect; and a soft magnetic member that converts a vertical magnetic field component input from the outside from a direction perpendicular to the substrate into a horizontal magnetic field component in a direction along the substrate and that provides the horizontal magnetic field component to the magnetoresistive element, wherein the soft magnetic member is arranged with a space in a height direction between the soft magnetic member and the magnetoresistive element, wherein the magnetoresistive element is formed in such a manner as to extend in an X1-X2 direction and has a sensitivity axis in a Y1-Y2 direction, the X1-X2 direction and the Y1-Y2 direction being orthogonal to each other in a plane along the substrate, wherein the soft magnetic member is formed of a first soft magnetic portion extending in the X1-X2 direction and a second soft magnetic portion extending in the Y1-Y2 direction combined together, and wherein the magnetoresistive element is arranged in a location in which the magnetoresistive element is capable of receiving the horizontal magnetic field component in the Y1-Y2 direction from the first soft magnetic portion, characterized int that the magnetoresistive element includes a current bypass electrode layer arranged thereon in a location facing, in the height direction, the second soft magnetic portion or in a location facing, in the height direction, an intersection portion of the first soft magnetic portion and the second soft magnetic portion. a magnetoresistive element that is formed by stacking a magnetic layer and a non-magnetic layer on a substrate and that exhibits a magnetoresistive effect; and a soft magnetic member that converts a vertical magnetic field component input from the outside from a direction perpendicular to the substrate into a horizontal magnetic field component in a direction along the substrate and that provides the horizontal magnetic field component to the magnetoresistive element, wherein the soft magnetic member is arranged with a space in a height direction between the soft magnetic member and the magnetoresistive element, wherein the magnetoresistive element is formed in such a manner as to extend in an X1-X2 direction and has a sensitivity axis in a Y1-Y2 direction, the X1-X2 direction and the Y1-Y2 direction being orthogonal to each other in a plane along the substrate, wherein the soft magnetic member is formed of a first soft magnetic portion extending in the X1-X2 direction and a second soft magnetic portion extending in the Y1-Y2 direction combined together, and wherein the magnetoresistive element is arranged in a location in which the magnetoresistive element is capable of receiving the horizontal magnetic field component in the Y1-Y2 direction from the first soft magnetic portion, characterized int that the magnetoresistive element includes a current bypass electrode layer arranged thereon in a location facing, in the height direction, the second soft magnetic portion or in a location facing, in the height direction, an intersection portion of the first soft magnetic portion and the second soft magnetic portion.