An air compressor is a mechanical device that converts power from an external source, such as an electric motor or engine, into potential energy stored in compressed air. It works by compressing and pressurizing the surrounding air, which can then be used for various applications.