Headspace (firearms)

In firearms, headspace is the distance measured from a closed chamber's breech face to the chamber feature that limits the insertion depth of a cartridge placed in it. Used as a verb by firearms designers, "headspacing" refers to the act of stopping deeper cartridge insertion. The exact part of the cartridge that seats against the limiting chamber feature differs among cartridge and gun designs. Bottleneck rifle cartridges headspace on their case shoulders; rimmed cartridges headspace on the forward surfaces of their case rims; belted cartridges headspace on the forward surfaces of their case belts; rimless pistol cartridges headspace on their case mouths.
When headspace is larger than the cartridge case, there is front-to-back cartridge wiggle room when the breech of the gun is closed. This extra space is called "head clearance". Many, including some major manufacturers, confuse head clearance with headspace in their literature. This commonplace error is explained in the glossary of firearms terms maintained by the Sporting Arms and Ammunition Manufacturers Institute (SAAMI) which is the ASTM standards organization for the domestic firearms and ammunition industry. Excessive head clearance is undesirable for several reasons. It can allow a cartridge's primer to slide beyond the reach of the firing pin to adequately indent the primer to achieve reliable ignition (though extractor hooks may act as the replacement headspace determinant in this situation). In chamber designs that don't fully support the case head, it can allow a case to expand excessively, which can thin or even burst the brass. Thus the cartridge can rupture rearward, which risks releasing hot gases under high pressure that can damage the firearm and injure or even kill the shooter or bystanders. 
If a chamber's headspace is too short, the gun may be unable to go fully into battery (close and lock completely), preventing firing.
Cartridge types.
All small arms cartridges have a flange at the base of the case called a rim. The part of the firearm called an extractor claw hooks over the rim to extract the spent case from the chamber after it has been fired. The cartridge is said to be of a "rimmed" type when the rim is of larger diameter than the remainder of the case. Most early cartridges were rimmed, and the rim-stop ledge at the rear of the chamber prevents the cartridge from moving forward. Headspace for rimmed cartridges is the space between that forward ledge and the bolt face when the action is closed.
The cartridge is said to be "rimless" if the extractor groove is machined into the head of the case so the rim is the same diameter as the adjacent part of the case. Most modern automatic firearms use rimless cartridges. Straight-walled rimless cartridges often headspace on the forward lip of the cartridge as shown in the diagram at the top of this article. This necessitates careful attention to consistent case length. Bottle-necked rimless cartridges may headspace on the conical shoulder between the narrow neck and the larger diameter portion of the case.
Some large rimless magnum cartridges have a "belt" formed above the extractor groove. This belt is of slightly larger diameter than the adjacent case, so the cartridge can headspace from the forward edge of the belt closest to the bullet. The original purpose of the belt was to give accurate headspacing for cartridges with shallow shoulder angles, where longitudinal precision of seating using such a shoulder presents difficulties. In effect this was similar to the headspacing function of a rim, but gave a long enough surface for cartridges to lie side-by-side in a magazine without risk of interference during the feed-stroke. The adoption of the belt as headspacing feature on rounds such as the .300 H&H Magnum and its derivatives ultimately started a fashion that resulted in most later magnum rifle cartridges featuring belts.
Some more or less straight cartridges have no bottleneck on which to headspace. Such cylindrical shaped cartridge cases use the case mouth (the forward end of a cartridge case) as a forward positioned flange used for headspacing.
C.I.P. ammunition approval procedure and headspace.
The standards organization Commission Internationale Permanente pour l'Epreuve des Armes à Feu Portatives (Permanent International Commission for Firearms Testing - commonly abbreviated as C.I.P. or CIP) uses a rimless, rimmed, magnum, pistol and revolver and rimfire cartridges classification to differentiate between hundreds of different small arms chamberings. The dimensional checking of the ammunition, as described in the C.I.P. Decisions, Texts and Tables, is left to the manufacturers themselves. During C.I.P. ammunition approval headspace is not checked, even on rimless cartridges with taper. The view is that in the very unlikely case (according to the current quality standards) the cartridge is too long, once pressed by the bolt, the pressure will rise too high causing rejection. If it is too short, firing will fail also causing rejection.
Theory.
A firearm cartridge case serves multiple functions. The most obvious role is to provide a container for the powder, bullet, and primer. Additionally though, upon firing, the expanding case seals the breech of the firearm to prevent burning powder gas from escaping rearward. Most cartridge cases are made of brass and expand under pressure to form a closed gas tight fit with the sides of the chamber, and then contract slightly so that the case remains loose and can be removed. Centerfire cartridge cases are thicker near the base to prevent expansion into openings between the rear end of the barrel and the action where the cartridge case is not fully enclosed or supported by the chamber.
When a firearm has more headspace than the cartridge design anticipated, the closing of the bolt or impact of the firing pin may move the cartridge forward to leave space between the chamber face of the action and the base of the cartridge. Pressure of burning powder gasses expands the thinner forward walls of the cartridge case to firmly grip against the sides of the chamber preventing rearward motion. The thicker base of the cartridge case (or sometimes the primer) may then be forced back into available space at the rear of the chamber, causing the case to stretch. Where rearward movement exceeds cartridge design, the primer may rupture or the base of the cartridge case may begin to separate from the forward walls. Either type of failure may release high pressure gas and case fragments from the action of the firearm. These may cause burns, cuts, or eye injury to the shooter or persons standing nearby.
Headspace is a critical consideration in any firearm. It should be checked by a competent person using the appropriate headspace gauges prior to using the firearm.
Gauges.
To check that a firearm's headspace is within manufacturer's tolerances, manufacturers supply Go/no go gauges. These gauges are pieces of tool steel, cut to precise lengths. They're shaped like cartridges so they fit in the firearm's chamber. The firearm's bolt should close normally on the "go" gauge, and should not close on the "no-go" gauge.
A third gauge, the "Field" gauge (slightly larger than "no-go"), is used in the field to indicate the absolute maximum safe headspace. This gauge is used because, over time, the bolt and receiver will wear, the bolt and lugs compress, and the receiver may stretch, all causing the headspace to gradually increase from the factory specifications measured by the "go" and "no-go" gauges. A bolt that closes on "no-go" but not on "field" is close to being unsafe to fire, and may malfunction on cartridges that are slightly out of specification. 
Headspace gauges are typically used by inserting the gauge into the bolt face engaging the extractor claw and then into the firearm chamber, and noting upon which gauge the bolt fully closes, and which it does not. The closing force applied to the bolt on a bolt-action firearm when making these assessments should be consistently and lightly applied; otherwise, an incorrect assessment of headspace will result if the bolt is forced close with excessive pressure.
The below table illustrates the function of each gauge:
Other cartridge dimensions.
Headspace is not the only important cartridge dimension. Other dimensions like overall cartridge length and base diameter are also significant for proper fit of a cartridge into a firearm, and may be included as part of a headspace gauge. Cartridges very close to chamber dimensions generally offer superior accuracy, but slightly undersized cartridges load more smoothly and reliably under variable temperature conditions or when fouling accumulates in the chamber or cartridges become corroded.
A firearm chamber for rimmed ammunition will often have two small ledges or steps. One at the rear engages with the forward face of the rim, as the rim-stop. The other step in the front of the chamber accommodates the thickness of the case wall at the forward edge of the case neck where the projectile emerges as a close fit to the beginning of the bore, the throat or leade. If the case length is too long, then the bolt on closing pushes the case over the forward step of the chamber at the throat / leade and can crush or crimp the case around the projectile at the neck of the case, leading to all sorts of performance, pressure and safety problems. 
Many target shooters who use rimmed ammunition, such as .303 British, will carefully sort the cases by headstamps into groups of the same make or batch, then gauge the thickness of the case rim into lots of the same, or very close, rim thickness. They then keep the fire-formed cases which are now optimised in shape to that firearm chamber, thereby increasing the accuracy potential by only having to resize the neck of the case and to trim-to-length so that the batch performance of the reloaded ammunition is as consistent as is possible from shot to shot. Some competition reloaders leave the primer slightly proud of the case by a known amount that is taken up when the bolt is locked home. This mechanical action on the center of the case base via the primer, as it is pushed a very small amount further into its cup, translates into an even distribution of pressure through the rim to the rim-stop. This also gives the advantage of the firing pin indenting the primer in a similar fashion from shot to shot as the primer cup is in direct contact with the bolt face. As with any reloading all care must be taken and manufacturer's recommendations followed.