The invention relates to a linear compressor, and specifically provides a linear compressor comprising an outer stator, an inner stator arranged in the radial inner side of the outer stator at a preset gap, and a front flange arranged on the axial side of the outer stator; specially, the inner stator is provided with a coil; the axial length of the outer stator is bigger than that of the inner stator, thus reducing or preventing magnetic field, generated by the coil, from leaking outside the inner and outer stator; the inner periphery, close to the end portion of the front flange of the linear compressor, of the outer stator is provided with a groove. In the axial direction of the linear compressor, the outer stator is bigger in length than the inner stator, thus greatly reducing or preventing magnetic field, generated by the coil, from leaking outside the inner and outer stator, improving magnetic field density in the inner and outer stators, and obviously improving linear compressor efficiency.