FIRST CH TOOLS / DESIGN / 52 CSS BOX-SHADOW GENERATOR

CSS box-shadow Generator

Shape a CSS shadow with sliders and copy the result. It is built around layered shadows: stack as many as you need, or press Make it smooth to split one shadow into a stack of faint ones. Presets for Material elevation, neumorphism and focus rings, plus paste-in of a box-shadow copied out of DevTools.

Dial in the shadow

Preview

The preview frame is overflow: hidden. A shadow that runs past the frame gets clipped here for exactly the reason it would on a real page: a shadow takes no layout space, so any ancestor that clips will cut it off.

Shadow layers

The top row is the front layer — CSS paints the first shadow in the list on top. Make it smooth splits the selected layer into a stack of faint ones: the offset and blur grow step by step, and the opacity is shared out as 1-(1-α)^(1/n) so the stack ends up as dark as the single shadow you started from.

Selected layer
Offset X px
Offset Y px
Blur px
Spread px

Colours may be HEX, rgb(), hsl(), oklch() or a CSS colour name. The opacity slider is the alpha of that colour; the swatch next to it only carries the opaque part.

Load an existing shadow

Paste a value straight out of DevTools, with the box-shadow: prefix and the trailing ; if you like. Lengths are read in px (and a bare 0) only — em and rem depend on the font size in context, so they are deliberately not guessed at.

2
layers stacked
0px
reach beyond the box
0%
darkest point
0
characters of CSS
Generated CSS

  
Notes on this shadow

    Mix the shadow colour in the Color Converter, build the background behind it with the CSS Gradient Generator, pick the speed curve for a shadow that animates in the Easing Preview, and check how far the shadow reads against its background with the Contrast Checker.

    How to Use

    1. Set the sceneMatch the preview's background colour, element colour and corner radius to the screen you are designing. A shadow changes character with what is underneath it — one tuned on white all but vanishes on a grey page.
    2. Stack the shadowSet X, Y, blur, spread and opacity with the sliders, then press "+ Stack one" for a second layer, or "Make it smooth" to split one into a faint stack. Loading a Material or neumorphism preset and editing from there is often quicker.
    3. Copy it out"Copy value" gives you the box-shadow value on its own; "Copy declaration" includes the property. Pick the colour syntax (rgb(… / …), rgba() or HEX) that matches your codebase.

    About This Tool

    A CSS shadow is four numbers and a colour. They come in the order box-shadow: X Y blur spread colour;, with an optional inset at the front to throw the shadow inside the box. This tool puts all five on sliders and shows the result on a real element next to the CSS. The preview's background colour, element colour, corner radius and size are adjustable too, so the shadow can be judged in the conditions it will actually live in — a shadow tuned on a white card is often invisible on a grey page.

    Layered shadows are the point of the page. A real shadow is tight and dark near the object and wide and faint further away, both at once, and a single box-shadow can only be one of those. Stacking a few faint layers reads as far more natural at the same overall darkness. "Make it smooth" splits the selected layer into n layers, growing the offset and blur step by step while sharing the opacity out as 1-(1-α)^(1/n). Stacked opacity multiplies rather than adds — n layers at α come out at 1-(1-α)ⁿ — so dividing it that way keeps the total darkness fixed no matter how many layers you ask for.

    You can start from the CSS you already have. Paste a value copied out of DevTools, with or without the box-shadow: prefix and trailing semicolon, and it is broken back into editable layers (lengths in px and bare 0 only). A single outer shadow with no spread is also printed as filter: drop-shadow(). The blur number halves in that form because drop-shadow() takes the standard deviation of the Gaussian blur, which is half the blur radius box-shadow asks for.

    It also flags the ways shadows go wrong. The notes list catches shadows that cannot be seen at all, shadows dark enough to look dirty, a reach large enough to be clipped by an overflow: hidden parent, and inset shadows on elements where they will never paint. Generation and checks all happen in the browser and nothing is uploaded. Directly callable via URL parameters: /en/box-shadow/?css=0 10px 15px -3px rgb(0 0 0 / 0.1)&bg=%23faf8f4&radius=12

    Other Tools