An electrical machine is a device which converts mechanical energy into electrical energy or vice versa. Thus, electrical generators and electrical motors are both electrical machines. Transformers are also electrical machines, which do not convert between mechanical and electrical forms but instead transform AC power from one voltage level to another.