In the context of an internal combustion engine, the term stroke has the following related meanings:
- A phase of the engine's cycle (e.g. compression stroke, exhaust stroke), during which the piston travels from top to bottom or vice versa.
- The type of power cycle used by a piston engine (e.g. two-stroke engine, four-stroke engine).
- "Stroke length", the distance travelled by the piston during each cycle. The stroke length––along with bore diameter––determines the engine's displacement.
Phases in the power cycle
Commonly used engine phases/strokes (i.e. those used in a four-stroke engine) are described below. Other types of engines can have very different phases.
The induction stroke is the first phase in a four-stroke (e.g. Otto cycle or Diesel cycle) engine. It involves the downward movement of the piston, creating a partial vacuum that draws a fuel/air mixture (or air alone, in the case of a direct injection engine) into the combustion chamber. The mixture enters the cylinder through an intake valve at the top of the cylinder.
The compression stroke is the second of four stages in a four-stroke engine.
In this stage, the fuel/air mixture (or air alone, in the case of a direct injection engine) is compressed to the top of the cylinder by the piston. This is the result of the piston moving upwards, reducing the volume of the chamber. Towards the end of this phase, the mixture is ignited — by a spark plug for petrol engines or by self-ignition for diesel engines.
The combustion stroke is the third phase, where the ignited air/fuel mixture expands and pushes the piston downwards. The force created by this expansion is what creates an engine's power.
The exhaust stroke is the final phase in a four stroke engine. In this phase, the piston moves upwards, squeezing out the gasses that were created during the combustion stroke. The gasses exit the cylinder through an exhaust valve at the top of the cylinder. At the end of this phase, the exhaust valve closes and the intake valve opens, which then closes to allow a fresh air/fuel mixture into the cylinder so the process can repeat itself.
Types of power cycles
The thermodynamic cycle used by a piston engine is often described by the number of strokes to complete a cycle. The most common designs for engines are two-stroke and four-stroke. Less common designs include five-stroke engines, six-stroke engines and two-and-four stroke engines.
Two-stroke engines complete a power cycle every two strokes, which means a power cycle is completed with every crankshaft revolution. Two-stroke engines are commonly used in (typically large) marine engines, outdoor power tools (e.g. lawnmowers and chainsaws) and motorcycles. 
Engine displacement is calculated by multiplying the cross-section area of the cylinder (determined by the bore) by the stroke length. This number is multiplied by the number of cylinders in the engine, to determine the total displacement.
The term stroke can also apply to movement of the piston in a locomotive cylinder.