A firearm is a device which projects either single or multiple projectiles at high velocity through a controlled explosion. The firing is achieved by the gases produced through rapid, confined burning of a propellant. This process of rapid burning is technically known as deflagration. In older firearms, this propellant was typically black powder, but modern firearms use smokeless powder, cordite, or other propellants. Most modern firearms (with the notable exception of smoothbore shotguns) have rifled barrels to impart spin to the projectile for improved flight stability.
In the Middle Ages the term "firearm" was used in English to denote the arm in which the match was held that was used to light the touch hole on the hand cannon. The term was a variation on the contemporary terms of bow arm and drawing arm still used in archery. Due to the effects of firing the ordnance (barrel) at the time, the gunner had to be located somewhat behind the weapon, steadying brace with the other hand, hence the name "hand gun" became synonymous with the "fire arm". Although the modern term 'gun' is often used as a synonym for firearm, in specialist or military use it has a restricted sense referring only to an artillery piece with a relatively high muzzle velocity, such as a field gun, a tank gun, or a gun used in the delivery of naval gunfire. Artillery guns are much larger than these firearms, mounted on a movable carriage, having bores of up to 18 inches (46 cm) and possibly weighing many tons. Strictly speaking, such weapons are not firearms.
Hand-held firearms, like rifles, carbines, pistols and other small firearms are rarely called "guns" in the restricted sense among specialists. Machine guns fire small caliber ammunition (generally 14.5 mm or smaller), and many machine guns are crew served infantry support weapons, requiring the services of more than one crewman, just like artillery guns. Generally, an automatic firearm designed for a single user is referred to as an automatic rifle. Other terms, including "firearm" itself, have been defined in specialized ad hoc ways by various legislation.
In recent centuries, firearms have become the predominant weapons used by mankind. Modern warfare since the late Renaissance has relied upon firearms, with wide-ranging effects on military history and history in general. This created a whole new kind of battle, which molded modern-era armies.
For handguns and long guns, the projectile is a bullet, or in historical hand cannons, a shot. The shot was initially made from lead already used as ammunition for the slings, and ironically begun with ballistic shape of a modern bullet, but was rapidly replaced by the cast iron ball. The projectile is fired by the burning of the propellant, but in small arms rarely contains explosives itself as such ammunition is banned by the Hague Convention. The use of expanding (e.g. hollow-point) small-arms ammunition in warfare is also banned by the Convention for similar reason (it aggravates the severity of wounds from small-arms fire). For modern artillery the projectile is a shell, which almost always contains explosives, and explosives were also common in older artillery pieces as well.
Until the mid-1800s, projectiles and propellant (black powder) were generally separate components used in a muzzle-loading firearm such as a rifle, pistol, or cannon. Sometimes for convenience a suitable amount of powder and a bullet were wrapped in a paper package, known as a cartridge. This evolved into the form of a tubular metal casing enclosing a primary igniter (primer) and the powder charge, with the projectile press-fit into the end of the casing opposite the primer. Cartridge ammunition was widely adopted, and as of World War I it had become the primary form of ammunition for small arms, tanks, and artillery. Mortars use a similar concept of encapsulation; however the projectile and casing are generally a single piece that is launched from the firearm. Some short-range naval guns use cased ammunition, but many battleship and cruiser main guns use a shell and separate bagged powder measures, which are selected according to the desired ballistic path.
A distinction is sometimes made between the projectile itself as the weapon and the firearm as a weapons platform. In some cases, the firearm can be used directly as a weapon without firing a projectile, although this is virtually always a secondary method of attack used in close combat. For example, arms such as rifles, muskets, and occasionally submachine guns can have bayonets affixed to them, becoming in effect a spear or pike. With some notable exceptions, the stock of a long gun can be used as a club. It is also possible to strike someone with the barrel of a firearm or grasp it by the barrel or grip and strike someone with the butt, which is informally called "pistol-whipping".
A problem for firearms is the accumulation of waste products from the partial combustion of propellants, metallic residue from the bullet itself, and small flecks of the cartridge case, known as fouling or gunshot residue. These waste products can interfere with the internal functions of the firearm. As a result, regularly used firearms must be periodically partially disassembled, cleaned and lubricated to ensure the firearm’s reliability.
Firearms may sometimes be referred to as small arms. Small arms are firearms which can be carried by a single individual. According to international conventions governing the Laws of War, small arms are defined (with some exceptions) as firearms which fire a projectile not in excess of 15 mm (0.60 inches) in diameter. Small arms are aimed visually at their targets by hand using either iron sights or optical sights . The range of pistols is generally limited to about 50 meters, while most rifles accurate to about 150 meters using iron sights, or up to 600 meters using optical sights. Some purpose-built sniper rifles are accurate to ranges of over 2000 m. The current record for a successful sniper attack is slightly more than 1.5 miles (2.4 km).