A transformer (1; 2), comprising: a core (1a, 1b; 2a, 2b); a first coil portion disposed so as to cover at least part of the core (1a, 1b; 2a, 2b); and a second coil portion disposed so as to cover a periphery of the first coil portion in a direction perpendicular to a central axis of winding of the first coil portion, wherein the first coil portion and the second coil portion each include a bobbin (20; 98) and a coil (10; 10X) wound around the bobbin (20; 98), and the coil (10; 10X) of at least one of the first coil portion and the second coil portion is an edgewise coil, wherein the bobbin (20; 98) of at least one of the first coil portion and the second coil portion includes: a tubular bobbin body (20a; 98a); and a plurality of position-limiting protruding portions (21, 22, 23, 24; 91, 92, 93, 94) arranged in a plurality of portions on an outer peripheral surface of the bobbin body (20a; 98a) and limiting a position of a winding portion of the coil (10; 10X) in an axial direction of the bobbin body (20a; 98a), wherein the plurality of position-limiting protruding portions (21, 22, 23, 24; 91, 92, 93, 94) include a first position-limiting protruding portion (21b, 22b, 23b, 24b) and a second position-limiting protruding portion (21z, 22z, 23z, 24z) that are disposed at positions different from each other in the axial direction of the bobbin body (20a; 98a), and wherein the edgewise coil (10; 10X) is in a state of space winding in which individual winding portions are spaced apart from each other in the axial direction of the bobbin body (20a; 98a) by the plurality of position-limiting protruding portions (21, 22, 23, 24; 91, 92, 93, 94), wherein the bobbin body of the first coil portion has the position-limiting protruding portions, and the second coil portion is disposed in a manner such that the inner peripheral surface of the bobbin body of the second coil portion is in contact with a corner of the position-limiting protruding portions of the first coil portion. a core (1a, 1b; 2a, 2b); a first coil portion disposed so as to cover at least part of the core (1a, 1b; 2a, 2b); and a second coil portion disposed so as to cover a periphery of the first coil portion in a direction perpendicular to a central axis of winding of the first coil portion, wherein the first coil portion and the second coil portion each include a bobbin (20; 98) and a coil (10; 10X) wound around the bobbin (20; 98), and the coil (10; 10X) of at least one of the first coil portion and the second coil portion is an edgewise coil, wherein the bobbin (20; 98) of at least one of the first coil portion and the second coil portion includes: a tubular bobbin body (20a; 98a); and a plurality of position-limiting protruding portions (21, 22, 23, 24; 91, 92, 93, 94) arranged in a plurality of portions on an outer peripheral surface of the bobbin body (20a; 98a) and limiting a position of a winding portion of the coil (10; 10X) in an axial direction of the bobbin body (20a; 98a), a tubular bobbin body (20a; 98a); and a plurality of position-limiting protruding portions (21, 22, 23, 24; 91, 92, 93, 94) arranged in a plurality of portions on an outer peripheral surface of the bobbin body (20a; 98a) and limiting a position of a winding portion of the coil (10; 10X) in an axial direction of the bobbin body (20a; 98a), wherein the plurality of position-limiting protruding portions (21, 22, 23, 24; 91, 92, 93, 94) include a first position-limiting protruding portion (21b, 22b, 23b, 24b) and a second position-limiting protruding portion (21z, 22z, 23z, 24z) that are disposed at positions different from each other in the axial direction of the bobbin body (20a; 98a), and wherein the edgewise coil (10; 10X) is in a state of space winding in which individual winding portions are spaced apart from each other in the axial direction of the bobbin body (20a; 98a) by the plurality of position-limiting protruding portions (21, 22, 23, 24; 91, 92, 93, 94), wherein the bobbin body of the first coil portion has the position-limiting protruding portions, and the second coil portion is disposed in a manner such that the inner peripheral surface of the bobbin body of the second coil portion is in contact with a corner of the position-limiting protruding portions of the first coil portion.