Box Shadow Generator
Layered CSS box-shadow with a live preview: offset, blur, spread, colour and opacity per layer, inset shadows, px or rem output, and the CSS ready to paste.
A box-shadow declaration you can paste, one line or one layer per line, with the shadow’s reach beyond the box stated so layouts can allow for it.
Example: One layer, offset 0 4, blur 12, spread 0, black at 12 % → box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.12); reaching 16 px below and 8 px above the box.
The CSS you paste,
written the way the spec reads it.
What each number does, how layers stack, how far a shadow reaches, and why the output uses rgba().
The five values
A box-shadow layer is offset-x offset-y blur-radius spread-radius color, with an optional inset keyword in front (CSS Backgrounds and Borders Level 3, §7.2). The offsets move the shadow; a positive y moves it down. The blur radius softens the edge — the specification asks for a Gaussian blur whose standard deviation is half the radius, so the fade spans roughly the blur radius. The spread radius grows (positive) or shrinks (negative) the shadow's shape before blurring; a negative spread with a large blur gives the "floating" look without a halo at the sides. Inset shadows are drawn inside the box, above its background and below its content.
Layers, reach, and units
Layers are comma-separated and painted back to front, so the first layer in the list ends up on top. The page reports how far the combined shadow reaches beyond the box on each side — blur plus spread, shifted by the offset — as a guide for spacing and overflow; it is an approximation of the fade, not a hard edge. Lengths are written in px by default; rem or em divides by the base you set (16 px unless your root font size differs) so shadows scale with type. Zero lengths are written as a bare 0, as the grammar allows.
Colour and opacity
Each layer's colour is entered as a hex value with a separate opacity and written as rgba(r, g, b, a), so the alpha is visible in the output and easy to tune in a stylesheet. Shadows nearly always need transparency: a fully opaque grey looks painted on, while black at 8–25 % reads as a shadow on most backgrounds. The presets are starting points chosen by eye, not measurements; adjust them to your surface.
What the tool does not settle
Rendering differs slightly between engines, especially for large blurs; check the real page. Text and image shadows use different properties (text-shadow, filter: drop-shadow) with their own grammar. The preview uses this site's background; your surface colour changes how the same shadow reads. Nothing you enter leaves the browser; the same four anonymous usage counts as the rest of the site apply.
SOURCES
- W3C CSS Backgrounds and Borders Module Level 3 — §7.2 the box-shadow property
- W3C CSS Color Module Level 4 — rgb() and rgba() syntax
Last reviewed 19 September 2026. How results are checked: How we verify.