A motor having an improved structure that prevents infiltration of moisture into the motor and a washing machine having the same. A washing machine includes a body, a tub disposed in the body, a drum rotatably disposed in the tub, and a motor including a stator coupled to a rear surface of the tub and a rotor rotatably disposed inside the stator. The stator includes a stator core, a first insulator and a second insulator to cover both ends of the stator core, and at least one moisture infiltration prevention member disposed between the first insulator and the second insulator to prevent infiltration of moisture into the stator core.