The present invention provides a linear motor, wherein, a coil is fastened on a mass block that is suspended inside a housing, a first magnet and a second magnet that have opposite magnetic poles are symmetrically disposed at an upper side and at a lower side relative to the coil in the middle and positioned parallel to the centric plane of the coil, by arranging an upper magnetic steel and a lower magnetic steel at an upper side and at a lower side relative to the mass block in the middle and parallel to the mass block. In the linear motor of the present invention, the design route that utilizes coil motion to drive mass block motion is different from the traditional route that utilizes magnet motion to drive mass block motion. When the coil moves to either of the two lateral sides of the housing, both the first magnet and the second magnet simultaneously generate forces along a vertical direction of the housing, and as the first magnet and the second magnet having opposite magnetic poles are symmetrically disposed on both sides of the coil, the electromagnetic forces generated by the two magnets are equal in magnitude and opposite in direction, thus being counterbalanced with each other in the vertical direction, so as to ensure that the coil only moves back and forth in a horizontal direction, without generating vibration in a vertical direction, therefore, no noise related to vertical vibration is caused.