A wind turbine is a machine that converts the mechanical energy of wind into electrical energy. It does this through features that allow the wind to spin turbine blades, which spin a shaft to generate electricity. If the mechanical energy is used for tasks like pumping water or grinding grain, the machine is called a windmill.