A windmill is a machine that is used to convert the energy from the wind blowing past into more useful energy. Windmills have several blades or sails that catch the wind as it goes past, and the sails turn around. Inside the windmill is other machinery that does useful work as the wind turns the sails outside. Windmills were used to mill grain into flour, hence their name. Windmills can also be used to pump water out of wells. More recently wind has been used to generate electricity. The version of the windmill that is used for this is called a wind turbine.