A gear or cogwheel is a rotating machine part having cut teeth, or cogs, which mesh with another toothed part to transmit torque. Geared devices can change the speed, torque, and direction of a power source. Gears almost always produce a change in torque, creating a mechanical advantage, through their gear ratio, and thus may be considered a simple machine. The teeth on the two meshing gears all have the same shape. Two or more meshing gears, working in a sequence, are called a gear train or a transmission. A gear can mesh with a linear toothed part, called a rack, thereby producing translation instead of rotation.
The gears in a transmission are analogous to the wheels in a crossed, belt pulley system. An advantage of gears is that the teeth of a gear prevent slippage.
When two gears mesh, if one gear is bigger than the other, a mechanical advantage is produced, with the rotational speeds, and the torques, of the two gears differing in proportion to their diameters.
In transmissions with multiple gear ratios—such as bicycles, motorcycles, and cars—the term "gear" as in "first gear" refers to a gear ratio rather than an actual physical gear. The term describes similar devices, even when the gear ratio is rather than , or when the device does not actually contain gears, as in a continuously variable transmission.
Early examples of gears date from the 4th century BC in China (Zhan Guo times – Late East Zhou dynasty), which have been preserved at the Luoyang Museum of Henan Province, China. The earliest gears in Europe were circa AD 50 by Hero of Alexandria, but they can be traced back to the Greek mechanics of the Alexandrian school in the 3rd century BC and were greatly developed by the Greek polymath Archimedes (287–212 BC).