Box Shadow Generator

Box Shadow Generator — drag X, Y, blur, spread, colour, alpha. Stack up to 4 layers for Material-style depth, toggle inset, copy the CSS. Free.

Shadow layers
Shadow values
X 0px
Y 12px
Blur 24px
Spread 0px
Alpha 0.15
Inset shadow inside the box
Preview
Generated CSS

                        

Tailwind:

About Box Shadow Generator

Frequently asked questions

`box-shadow` is the CSS property that paints a shadow around (or inside) an element. The syntax is `box-shadow: <x-offset> <y-offset> <blur> <spread> <colour>` — for example `box-shadow: 0 12px 24px 0 rgba(0, 0, 0, 0.15)` is a clean drop shadow that sits 12px below the element. Add the `inset` keyword before the values to draw the shadow inside instead of outside. You can stack multiple shadows by separating them with commas, which is how designers build realistic layered depth.

**X offset** moves the shadow horizontally — positive pushes it right, negative pushes it left. **Y offset** moves the shadow vertically — positive pushes it down (the most common direction, since light comes from above), negative pushes it up. **Blur radius** controls how soft the edge of the shadow is — zero is a hard outline, larger values fade the shadow out gradually. **Spread radius** grows or shrinks the shadow before the blur is applied — positive makes the whole shadow larger, negative shrinks it so the shadow only shows under the element instead of leaking out the sides.

An **inset** shadow is drawn inside the element instead of outside, making the box look pressed-in or recessed. The CSS is the same four values but with the `inset` keyword in front: `box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1)`. Use inset for input fields (a tiny inset shadow at the top makes the control feel recessed), pressed button states, and skeuomorphic interfaces. Toggle the **Inset** switch in the generator and the preview will flip from outside the box to inside immediately.

**Blur** softens the edge — think of it as how far the shadow fades from solid to transparent. **Spread** grows or shrinks the entire shadow shape before blur is applied. A `0 4px 0 4px black` shadow is a hard 4px-wide ring around the element (no blur, +4 spread). A `0 4px 8px 0 black` shadow is a soft halo (8px blur, no spread). Negative spread is the secret trick designers use to make shadows feel tighter — it shrinks the shadow inward so it only shows below the element rather than leaking out the sides.