An air compressor is a machine that takes ambient air from the surroundings and discharges it at a higher pressure. It is an application of a gas compressor and a pneumatic device that converts mechanical power (from an electric motor, diesel or gasoline engine, etc.) into potential energy stored in compressed air, which has many uses. A common application is to compress air into a storage tank, for immediate or later use. When the delivery pressure reaches its set upper limit, the compressor is shut off, or the excess air is released through an overpressure valve. The compressed air is stored in the tank until it is needed. The pressure energy provided by the compressed air can be used for a variety of applications such as pneumatic tools as it is released. When tank pressure reaches its lower limit, the air compressor turns on again and re-pressurizes the tank. A compressor is different from a pump because it works on a gas, while pumps work on a liquid.
Compressors may be classified according to the pressure delivered:
There are numerous methods of air compression, divided into either positive-displacement or roto-dynamic types.
Positive-displacement compressors work by forcing air through a chamber whose volume is decreased to compress the air. Once the pressure is greater than the pressure outside the discharge valve, a port or valve opens and air is discharged into the outlet system from the compression chamber. Common types of positive displacement compressors are
The capacities for both single-stage and two-stage compressors are generally specified in Standard Cubic feet per Minute (SCFM) or litres per minute and pounds per square Inch (PSI) or bar. To a lesser extent, some compressors are rated in actual cubic feet per minute (ACFM).[clarification needed] Still others are rated in cubic feet per minute (CFM).[clarification needed] Using CFM alone to rate a compressor is ambiguous because it represents a flow rate without a pressure reference. i.e. 20 CFM at 60 PSI.
Single stage compressors usually fall into the fractional through 5 horsepower range. Two-stage compressors normally fall into the 5 through 30 horsepower range.[clarification needed]
Roto-dynamic air compressors include centrifugal compressors where Rotating vanes impart kinetic energy to a gas and stationary passages convert velocity into a rise in pressure, and axial compressors, where rotor blades impart the kinetic energy and stator blades convert it to a rise in pressure.
Due to adiabatic heating, air compressors require some method of disposing of waste heat. Generally this is some form of air- or water-cooling, although some (particularly rotary type) compressors may be cooled by oil (that is then in turn air- or water-cooled). The atmospheric changes are also considered during cooling of compressors.[clarification needed] The type of cooling is determined by considering the factors such as inlet temperature, ambient temperature, power of the compressor and area of application. There is no single type of compressor that could be used for any application.
Main article: Compressed air
Air compressors have many uses, such as supplying clean high-pressure air to fill gas cylinders, supplying clean moderate-pressure air to a submerged surface supplied air diver, supplying moderate-pressure clean air for driving some office and school building pneumatic HVAC control system valves, supplying a large amount of moderate-pressure air to power pneumatic tools, such as jackhammers, filling high pressure air tanks (HPA, air tank), for filling tires, and to produce large volumes of moderate-pressure air for large-scale industrial processes (such as oxidation for petroleum coking or cement plant bag house purge systems).
Air compressors are also widely used in oil and gas, mining and drilling applications as the flushing medium, aerating muds in underbalanced drilling and in air pigging of pipelines.
Most air compressors either are reciprocating piston type, rotary vane or rotary screw. Centrifugal compressors are common in very large applications, while rotary screw, scroll, and reciprocating air compressors are favored for small and medium-sized applications.
Air compressors are designed to utilize a variety of power sources. While direct drive gasoline or diesel-engines and electric motors are among the most popular, air compressors that utilize vehicle engines, power-take-off, or hydraulic ports are also commonly used in mobile applications.
The power of a compressor is measured in HP (horsepower) and CFM (cubic feet per minute of intake air). The volume of the pressure vessel and the stored pressure indicate the volume of compressed air (in reserve) available.
Gasoline and diesel-powered compressors are widely used in remote areas with problematic access to electricity. They are noisy and require ventilation for exhaust gases, particularly if the compressed air is to be used for a breathing air supply. Electric-powered compressors are widely used in production, workshops and garages with permanent access to electricity. Common workshop/garage compressors are 110-120 Volt or 230-240 Volt. Compressor tank shapes are: "pancake", "twin tank", "horizontal", and "vertical". Depending on a size and purpose compressors can be stationary or portable.
To ensure all compressor types run efficiently with no leaks, it is necessary to perform routine maintenance. The cost of maintenance only accounts for 8% of the life cycle cost of owning an air compressor. 
According to CAGI air compressor performance verification data sheets, the higher the isentropic efficiency is, the better the energy saving is. The better air compressor isentropic efficiency has reached 95%. 
Approximately 70~80% of the air compressor's total lifetime cost is energy consumption, so using the high-efficiency air compressor is one of the energy-saving methods.