The three most common causes of washing machine vibration are uneven loads, improper leveling and unstable flooring. The vibrations can be anything from a gentle rocking to a shaking that moves the machine across the floor. Front-loading machines are more prone to vibrating because they have faster spin cycles.
The uneven load scenario can happen when washing one large item, such as a blanket, heavy items, such as tennis shoes, or when several items get bunched together. As the washer spins, the imbalance causes the item, or items, to bounce against the drum. Stop the cycle, reposition the load and try again. If you are washing one item, try adding a second item to balance the load.
Washers have leveling feet which must be adjusted properly to account for uneven flooring. Usually done at installation, these feet sometimes need adjustment, especially if your machine gets heavy use. It's easier to have one person tilt up the washer while another adjusts the feet.
Washers work best when installed on cement, preferably in a basement or first floor location. If a washing machine is installed on a higher floor, the flooring may not have enough bracing to keep the machine from vibrating. A wood floor has some flexibility, which is sometimes transferred to a washer in use. Anti-vibration washer pads are a simple solution.