A pin is a device used for fastening objects or material together and can have three sorts of body: a shaft of a rigid inflexible material meant to be inserted in a slot, groove, or hole (as with pivots, hinges, and jigs); a shaft connected to a head and ending in a sharp tip meant to pierce one or more pieces of soft materials like cloth or paper (the straight or push pin); a single strip of a rigid but flexible material (e.g. a wire) whose length has been folded into parallel prongs in such fashion that the middle length of each curves towards the other so that, when anything is inserted between them, they act as a clamp (e.g. the bobby pin), or two strips of a rigid material bound together by a spring at one end so that, when the spring held open, one can insert some material between the prongs at the other end that, the spring allowed to close, then clamp the inserted material. According to their function, pins can be made of metals (e.g. steel, copper, or brass), wood, or plastic.
Pins have been found at archaeological sites dating as early as the Paleolithic, made of bone and thorn, and at Neolithic, Celtic and Ancient Roman sites. Neolithic sites are rich in wooden pins, and are still common through Elizabethan times. Metal pins dating to the Bronze Age have been found in Asia, North Africa and Europe, like the notable hammer-headed pins from the Kurgan burials in the northeastern Caucasus.
The development of the pin closely paralleled that of its perforated counterpart, the needle. Archaeological evidence suggests that curved sewing pins have been used for over four thousand years. Originally, these were fashioned out of iron and bone by the Sumerians and were used to hold clothes together. Later, pins were also used to hold pages of books together by threading the needle through their top corner.
Many later pins were made of brass, a relatively hard and ductile metal that became available during the Bronze Age. This development was followed by the use of steel which was much stronger but tended to rust when exposed to humid air. The development of inexpensive electroplating techniques allowed the steel to be plated with nickel. Nickel did not rust, but tended to flake off the steel in humid weather, again allowing it to rust. However, this took many months or even years to happen, and as nickel plated steel pins were usually used only temporarily to hold fabric in place prior to sewing, no further refinement has been considered necessary. Note, however, that some modern specialty pins are made out of rust-proof and very strong titanium.
A pinners guild was first established in London in 1356, spreading to other towns, but falling short of the quality produced by French pinmakers, discussed in the Art de l'épinglier (1761) where Henri-Louis Duhamel du Monceau gives details about the division of labor used by French pinmakers: 
There is nobody who is not surprised of the small price of pins; but we shall be even more surprised, when we know how many different operations, most of them very delicate, are mandatory to make a good pin.
John Ireland Howe invented a pin-making machine in 1832, and an improved machine in 1841; his Howe Manufacturing Company of Derby, Connecticut, used three machines to produce 72,000 pins per day in 1839.
Walter Hunt invented the safety pin by forming an eight-inch brass pin into a bent pin with a spring and guard. He sold the rights to his invention to pay a debt to a friend, not knowing that he could have made millions of dollars.
|Pin type||Typical size[Note 1]||Typical length||Features|
|Beading pins||14||7⁄8 in (22 mm)||A wider-than-usual-head allows this pin to hold beads more easily.|
|T-pins||0.75 mm||1+1⁄4 in (32 mm)||These pins have a head bent into a capital letter "T" to make it easier to grab with the finger tips.|
|Dressmaker pins||17-20||1+1⁄16 in (27 mm)||The most common type of sewing pin, they are used for light- to medium-weight fabrics and may have either a small flat head or a round plastic one.|
|Pleating pins||17||1+1⁄16 in (27 mm)||Considered "extra fine", they are used for pinning pleats and lightweight fabrics.|
|Appliqué pins||0.6 mm||3⁄4 in (19 mm)||Pins have small round glass heads that are easy to work around; also, because the pins are comparatively short, they are less likely to "stick out" when holding small pieces of fabric against a larger one.|
|Bridal and lace pins||17||1+1⁄4 in (32 mm)||These pins are made entirely of stainless steel and will not rust; they are used for fine and lightweight fabrics.|
|Patchwork pins||22 (0.5 mm)||1+7⁄16 in (37 mm)||Pins have extra sharp tips for penetrating thick iron-on patches; their size and length also make them suitable for quilting; they have glass heads that will not melt if pressed in an iron.|
|Quilting pins||30 (0.6 mm)||1+7⁄8 in (48 mm)||Quilting pins are exceptionally long and often have glass heads.|
|Silk pins||0.5 mm||1+7⁄16 in (37 mm)||Silk pins are suitable for lightweight fabrics and traditionally have a glass head that will not melt when ironed.|
|Pearlized pins||24||1+1⁄2 in (38 mm)||These have round plastic heads which have been painted (often in bright colors) to superficially resemble the appearance of pearls. Because the heads are plastic, there is a risk that they will melt if ironed at high temperatures.|
|Sequin pins||8 (0.5 mm)||1⁄2 in (13 mm)||Their exceptionally short length makes these pins suitable for appliqué; a large flat head allows them to hold sequins in place. Used for permanently holding sequins to styrofoam forms such as Christmas ornaments.|
|Tidy pins||-||1+1⁄2 in (38 mm)||U-shaped pins with no head are used for holding slip covers and doilies in place; often made of brass so that they will not rust; also called fork or loose cover pins.|
|Hatpins||-||8 in (20 cm)||These are exceptionally long decorative pins used to hold a woman's hat in place.|
The push pin was invented in 1900 by Edwin Moore and quickly became a success. These pins are also called "map pins" and are distinguished by having an easy to grip head. There is also a new push pin called a "paper cricket".
See also drawing pin or thumb tack.
Thin, hardened pins can be driven into wood with a hammer with the goal of not being seen.
In engineering and machine design, a pin is a machine element that secures the position of two or more parts of a machine relative to each other. A large variety of types has been known for a long time; the most commonly used are solid cylindrical pins, solid tapered pins, groove pins, slotted spring pins and spirally coiled spring pins.