A shim is a thin and often tapered or wedged piece of material, used to fill small gaps or spaces between objects. Shims are typically used in order to support, adjust for better fit, or provide a level surface. Shims may also be used as spacers to fill gaps between parts subject to wear.
Many materials make suitable shim stock (also often styled shimstock), or base material, depending on the context: wood, stone, plastic, metal, or even paper (e.g., when used under a table leg to level the table surface). High quality shim stock can be bought commercially, for example as laminated shims, but shims are often created ad hoc from whatever material is immediately available.
Laminated shim stock is stacked foil that can be peeled off one layer at a time to adjust the thickness of the shim.
In automobiles, shims are commonly used to adjust the clearance or space between two parts. For example, shims are inserted into or under bucket tappets to control valve clearances. Clearance is adjusted by changing the thickness of the shim.
On machinery installations (pumps, motors, etc.) the recommended practice requires shims under every equipment support foot. This guarantees a flexibility for adjustments, like a slight raising or lowering of a motor, when parts of the machinery need to be replaced.
In masonry, small stones may be used to align or fill gaps between larger bricks or slabs.
In luthiery, a thin strip of various materials (most often steel or wood) can be used beneath the nut or the saddle of a stringed instrument (such as a guitar, mandolin, ukulele or banjo) to raise the height of either. On guitars with a bolt-on or screwed-on neck, the angle of the neck can be adjusted by shimming. On some models a strip of sanding paper was routinely inserted during final adjustment at the factory. Guitarists have often used strips cut from business cards, credit cards or picks as shim material, while luthiery supply stores have started to sell specialized hardwood precision wedges for that purpose.
In nuclear magnetic resonance spectroscopy, "shimming an NMR magnet" is a procedure to generate homogeneous magnetic field along the sample volume to obtain pure Lorentzian line shapes of various resonances in the spectrum. This is accomplished by manual shimming of individual shims, or automatic shimming procedure.