The invention discloses an electromagnetic valve belonging to the field of valves and comprising a main valve and a pilot valve, wherein the main valve comprises a valve seat, and a piston accommodated in an inner cavity of the valve seat; the valve seat is provided with an input hole, an output hole and a pilot valve installing hole which are communicated with the inner cavity; the lower end part of the piston is sealed and covered on the output hole, the upper end part of the piston is provided with a groove, the bottom of the groove is provided with a piston valve hole communicated with the output hole; the pilot valve comprises a spring, a coil, a guide sleeve arranged on the pilot valve installing hole, a static iron core and a movable iron core, wherein the static iron core and the movable iron core are respectively arranged at the upper end and the lower end of an inner cavity of the guide sleeve, the coil is sleeved on the outer surface of the guide sleeve, the lower port of the guide sleeve is provided with a limit baffle ring, the lower end part of the movable iron core penetrates through a valve hole of a sealing piston of the limit baffle ring, the movable iron core is provided with an axial step through hole and a transverse hole which are penetrated, and the spring is arranged at the upper section of the step through hole and abuts and supports against the static iron core. The electromagnetic valve is characterized in that a transverse groove is arranged on the lower end face of the limit baffle ring, thus medium channel area between the input hole and the groove is reduced, valve-opening capacity is improved and energy-saving effect is realized.