A rimfire is a type of firearm cartridge. It is called a rimfire because instead of the firing pin of a gun striking the primer cap at the center of the base of the cartridge to ignite it (as in a centerfire cartridge), the pin strikes the base's rim.
The rim of the rimfire cartridge is essentially an extended and widened percussion cap which contains the priming compound, while the cartridge case itself contains the propellant powder and the projectile (bullet).
Once the rim of the cartridge has been struck and the bullet discharged, the cartridge cannot be reloaded, because the head has been deformed by the firing pin impact.
While many other different cartridge priming methods have been tried since the 19th century, only rimfire technology and centerfire technology survive today in significant use.
Rimfire cartridges are limited to low pressure calibers because they require a thin case so that the firing pin can crush the rim and ignite the primer. Although rimfire calibers up to .44 (11 mm) were once common, modern rimfires tend to be of caliber .22 (5.5 mm) or smaller. The low pressures mean that rimfire firearms can be very light and inexpensive, which has helped lead to the continuing popularity of small-caliber Rimfire Cartridges.
Rimfire cartridges are typically inexpensive, primarily due to the inherent cost-efficiency of the ability to make large production quantities (called "lots"). Until the price of metals used in cartridges (lead, copper and zinc) increased in 2002, a "brick" of 500 .22 Long Rifle cartridges typically cost less than US $8.00. Some US brands of 22LR could be purchased for less than $6 and when on sale for less than $5 per 500 rounds.
Beginning in 2003, the price increased to US$15.00–$20.00, with single boxes of 50 rounds going for about US$1.75–$2.50 each. Premium or match-grade .22 Long Rifle cartridges, as well as less common or out-of-production rimfire cartridges (such as the .22 Short, .22 Long, .22 Extra Long, .22 Winchester Auto, and 5 mm Remington Rimfire Magnum), can cost substantially more.
The idea of placing a priming compound in the rim of the cartridge evolved from an 1831 patent, which called for a thin case, coated all along the inside with priming compound.
By 1845, this had evolved into the Flobert .22 BB Cap, which distributed the priming compound just inside the rim. The .22 BB Cap is essentially just a percussion cap with a round ball pressed in the front, and a rim to hold it securely in the chamber. Intended for use in an indoor "gallery" target rifle, it used no gunpowder, but relied entirely on the priming compound for propulsion. Velocities were very low, comparable to an airgun. The next rimfire cartridge was the .22 Short, developed for Smith and Wesson's first revolver, in 1857; it used a longer rimfire case and 4 grains (260 mg) of black powder to fire a conical bullet.
This led to the .22 Long, same bullet weight as the short, but with a longer case and 5 grains (320 mg) of black powder. This was followed by the .22 Extra Long with a case longer than the .22 Long and a heavier bullet. The .22 Long Rifle is a .22 Long case loaded with the heavier Extra Long bullet intended for better performance in the long barrel of a rifle. The .22 Long Rifle is the most common cartridge in the world. Larger rimfire calibers were used during the Civil War in the Henry Repeater and the Spencer Repeater. While larger rimfire calibers were made, such as the, .30 rimfire, .32 rimfire, .38 rimfire .41 Short, the .44 Henry Flat devised for the famous Winchester 1866 carbine, up to the .58 Miller, the larger calibers were quickly replaced by centerfire versions, and today the .22 caliber rimfires are all that survive of the early rimfires.
The early 21st century has seen a revival in interest in rimfire cartridges, with two new rimfires introduced, both in .17 caliber (4.5 mm).
Below is a list of the most common current production rimfire ammunition:
- The powderless .22 Cap rounds, including BB Cap.
- .22 Short, used for target shooting and Olympic and ISSF 25 m Rapid Fire Pistol competition until 2005
- .22 Long (obsolete)
- .22 Long Rifle (.22 LR), the most common cartridge made
- .22 Stinger (slightly longer case, same overall loaded length) – the basis for the .17 HM2 
- .22 Winchester Rimfire (.22 WRF) AKA .22 Remington Special (obsolete)
- .22 Winchester Magnum Rimfire (.22 WMR)
- .17 Hornady Magnum Rimfire (.17 HMR), a .17 caliber based on the .22 WMR case
- .17 Hornady Mach 2 (.17 HM2), a .17 caliber based on the .22 Stinger case 
- 5 mm Remington Rimfire Magnum (recently put back into production by Aguila Ammunition/Centurion)
A new and increasingly popular rimfire, the 17 HMR is basically a .22 WMR with a smaller formed neck which accepts a .17 bullet. The advantages of the 17 HMR over .22 WMR and other rimfires are its much flatter trajectory, and its highly frangible hollow point bullets (often with plastic "ballistic tips" that improve the external ballistics performance). The .17 HM2 [Hornardy Mach 2] is based on the .22 Long Rifle and offers similar performance advantages over its parent cartridge, at a significantly higher cost. While .17 HM2 sells for about four times the cost of .22 Long Rifle ammunition (per box of 50 rounds), it is still significantly cheaper than most centerfire ammunition, and somewhat cheaper than the .17 HMR.
A notable rimfire still in production in Europe, and chambered by the Winchester Model 39 in the 1920s, is the 9 mm Flobert. This cartridge can fire a small ball, but is primarily loaded with a small amount of shot, and used in smoothbore guns as a miniature shotgun, or "garden gun". Power and range are very limited, making it suitable only for pest control. An example of rare but modern 9 mm Flobert Rimfire among hunters in Europe is the 1.75" Brass Shotshell manufactured by Fiocchi in Lecco, Italy using a .25 oz shot of #8 shot with a velocity of 600 fps.
Some ammunition products for the .22 LR fire a small amount of #11 or #12 shot (about 1/15th ounce). The shot is only marginally effective in close ranges, and is usually used for shooting rats or other small animals. It is also useful for shooting birds inside storage buildings as it will not penetrate walls or ceilings. At a distance of about 10 feet (3 m) the pattern is about 8 inches (20 cm) in diameter from a standard rifle, which is about the maximum effective range. Special smoothbore shotguns, such as Marlin's Garden Gun can produce effective patterns out to 15 or 20 yards using .22 WMR shotshells, which hold 1/8 oz. of #11 or #12 shot contained in a plastic capsule.
Shotshells will not feed reliably in some magazine fed firearms, due to the unusual shape of crimped brands, and the relatively fragile plastic tips of other brands. Shotshells will also not produce sufficient power to cycle semiautomatic actions, because, unlike projectile ammunition, nothing forms to the lands and grooves of the barrel to create the pressure necessary to cycle the firearm's action.
Rimfire ammunition is popular with ammunition cartridge collectors, who base much of the collectibility value of rimfire cartridges on the rarity of the stamped mark on the head of the cartridge (the headstamp). There is a subcategory of collectible rimfire ammunition with headstamps commemorating certain persons who have worked in the industry, often issued in extremely small quantities on the occasion of that person's retirement. Often the majority of these cartridges are given to the retiring individual, leaving him or her to decide to whom they are traded or distributed. This increases their perceived value as collectibles.
- Frank C. Barnes (2003) . Cartridges of the World (10th ed.). Krause Publications. ISBN 0-87349-605-1.
- Hornady .17 Mach 2
- 17 Mach 2
- Marlin's "Garden Gun" – Model 25MG Guns Magazine, March, 2000 by Clair Rees