A rivet gun, also known as a rivet hammer or a pneumatic hammer,  is a type of tool used to drive rivets. The rivet gun is used on rivet's factory head (the head present before riveting takes place), and a bucking bar is used to support the tail of the rivet. The energy from the hammer in the rivet gun drives the work and the rivet against the bucking bar. As a result, the tail of the rivet is compressed and work-hardened. At the same time the work is tightly drawn together and retained between the rivet head and the flattened tail (now called the shop head, or buck-tail, to distinguish it from the factory head). Nearly all rivet guns are pneumatically powered. Those rivet guns used to drive rivets in structural steel are quite large while those used in aircraft assembly are easily held in one hand. A rivet gun differs from an air hammer in the precision of the driving force.
Rivet guns vary in size and shape and have a variety of handles and grips. Pneumatic rivet guns typically have a regulator which adjusts the amount of air entering the tool. Regulated air entering passes through the throttle valve which is typically controlled by a trigger in the hand grip. When the trigger is squeezed, the throttle valve opens, allowing the pressurized air to flow into the piston. As the piston moves, a port opens allowing the air pressure to escape. The piston strikes against the rivet set. The force on the rivet set pushes the rivet into the work and against the bucking bar. The bucking bar deforms the tail of the rivet. The piston is returned to the original position by a spring or the shifting of a valve allowing air to drive the piston back to the starting position.
The slow-hitting gun strikes multiple blows as long as the trigger is held down. The repetition rate is about 2,500 blows-per-minute (bpm). It is easier to control than a one-hit gun. This is probably the most common type of rivet gun in use.
The fast-hitting gun strikes multiple light-weight blows at a high rate as long as the trigger is held down. These are repeated in the range of 2,500 to 5,000 bpm. The fast-hitting gun, sometimes referred to as a vibrator, is generally used with softer rivets.
The corner riveter is a compact rivet gun that can be used in close spaces. The rivet is driven at right-angles to handle by a very short barreled driver.
This gun is different from the above rivet guns in that the air pressure is used to provide a squeezing action that compresses the rivet from both sides rather than distinct blows. The squeeze riveter can only be used close to the edge because of the limited depth of the anvil[ jargon]. Once properly adjusted, the squeeze riveter will produce very uniform rivet bucks. The stationary (fixed) jaw is placed against the head and the buck is compressed by the action of the gun.
A pop rivet gun is made to apply pop rivets to a workpiece, and was invented in 1916 by Hamilton Wylie.  This type of rivet gun is unique in its operation, because it does not hammer the rivet into place. Rather, a pop rivet gun will form a rivet in-place.
The gun is fed over the rivet's mandrel (a shaft protruding from the rivet head) and the rivet tail is inserted into the work. When the gun is actuated (typically by squeezing the handle), a ball on the rivet's tail is drawn towards the head, compressing a metal sleeve between the ball and the head. This forms another "head" on the opposing side to the workpiece, drawing the work together and holding it securely in place. The mandrel has a weak point that breaks, or "pops" when the riveting process is complete. This style of rivet does not require the use of a bucking bar, because the force applied is away from the work.