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.
In carpentry, small pieces of wood may be used to align gaps between larger timbers. In luthiery, shims made of various materials are often used to adjust neck alignment and can be used beneath a nut or saddle to raise the height of either.
In masonry, small stones may be used to align or fill gaps between larger bricks or slabs.
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. 
Shim may refer to:
Shim (spacer), a thin and often tapered or wedged piece of material
Shim (computing), an application compatibility workaround
Shim (fencing), a device used in the sport fencing
Shim (magnetism), a device used to adjust the homogeneity of a magnetic field
Shim (lock pick), a tool used to bypass padlocks
Shim (band), an Australian hard rock band
Sim (Korean surname), pronounced "shim"
CPU shim, in computing, a component that may be placed between the CPU and its heatsink
Hill Shim, a hill in the Book of Mormon
The alternative moniker of Arya the cat, a popular British shorthair cat from Melbourne, AustraliaSHIM may refer to:
SHIM (born 1983), independent Israeli singer-songwriter, musician and artist
Second-harmonic imaging microscopy (SHIM)
Scanning helium ion microscope (SHIM)