A piston is a component of reciprocating engine
Reciprocating engine
A reciprocating engine, also often known as a piston engine, is a heat engine that uses one or more reciprocating pistons to convert pressure into a rotating motion. This article describes the common features of all types...

s, reciprocating pump
A pump is a device used to move fluids, such as liquids, gases or slurries.A pump displaces a volume by physical or mechanical action. Pumps fall into three major groups: direct lift, displacement, and gravity pumps...

s, gas compressor
Gas compressor
A gas compressor is a mechanical device that increases the pressure of a gas by reducing its volume.Compressors are similar to pumps: both increase the pressure on a fluid and both can transport the fluid through a pipe. As gases are compressible, the compressor also reduces the volume of a gas...

s and pneumatic cylinder
Pneumatic cylinder
Pneumatic cylinders are mechanical devices which utilize the power of compressed gas to produce a force in a reciprocating linear motion....

s, among other similar mechanisms. It is the moving component that is contained by a cylinder
Cylinder (engine)
A cylinder is the central working part of a reciprocating engine or pump, the space in which a piston travels. Multiple cylinders are commonly arranged side by side in a bank, or engine block, which is typically cast from aluminum or cast iron before receiving precision machine work...

 and is made gas-tight by piston ring
Piston ring
A piston ring is a split ring that fits into a groove on the outer diameter of a piston in a reciprocating engine such as an internal combustion engine or steam engine.The three main functions of piston rings in reciprocating engines are:...

s. In an engine, its purpose is to transfer force from expanding gas in the cylinder to the crankshaft
The crankshaft, sometimes casually abbreviated to crank, is the part of an engine which translates reciprocating linear piston motion into rotation...

 via a piston rod
Piston rod
In a piston engine, a piston rod joins a piston to a connecting rod.Many internal combustion engines, and in particular all current automobile engines, do not have true piston rods, and the term piston rod is often used as a synonym for connecting rod in the context of these engines.All engines...

 and/or connecting rod
Connecting rod
In a reciprocating piston engine, the connecting rod or conrod connects the piston to the crank or crankshaft. Together with the crank, they form a simple mechanism that converts linear motion into rotating motion....

. In a pump, the function is reversed and force is transferred from the crankshaft to the piston for the purpose of compressing or ejecting the fluid
In physics, a fluid is a substance that continually deforms under an applied shear stress. Fluids are a subset of the phases of matter and include liquids, gases, plasmas and, to some extent, plastic solids....

 in the cylinder.