Box Shadow Generator

Stack multiple shadow layers with sliders for offset, blur, spread, color and inset, preview on light or dark, and copy the CSS.

Shadows are generated locally in your browser. Nothing ever leaves your device.

Aa
Layers
Presets
Generated CSS

How It Works

A box-shadow value is five parts in a fixed order: offset-x (horizontal shift, positive goes right), offset-y (positive goes down), blur radius (how far the edge smears; 0 gives a hard silhouette), spread (shrinks or grows the shadow before it is blurred — negative tucks it in, positive puffs it out), and the color, here built from your picked hue plus an opacity slider that lands in the rgba() alpha. The inset keyword flips the whole thing to be painted inside the border-box instead of behind it.

Spread first, then blur
The mental model that matches the spec: spread resizes the shadow rectangle before blurring starts, and blur then smears from that new edge outward. That is why spread: -20px with blur: 0 is how you make a crescent under an element, and why a positive spread on an inset shadow paints a thick inner ring that still has soft feathered sides. Blur never "rescues" a spread value; it just feathers whatever spread left.
Layer order: first is on top
Comma-separated shadows stack with the first listed painted on top of the rest. In this builder the list panel shows the same order the CSS will have, and the up/down buttons reorder the stack. A useful pattern is a tight, dark first layer for the edge contact and a large soft later layer for ambient depth — reverse them and the soft layer washes over the crisp one.
Performance of large blurs
Blur is a Gaussian-style convolution, so cost grows with the blur radius and with how many shadowed pixels you have. Static shadows are painted once and are effectively free at rest; the risk is animating big blurred shadows, which repaints every frame. If a hover transition feels heavy, drop the blur radius, move fewer shadows, or cross-fade a pre-rendered pseudo-element shadow with opacity instead.

Frequently Asked Questions

Should hairlines be a border or a tiny shadow?

For a 1px ring that must not change the box size, the shadow trick wins: inset 0 0 0 1px paints the outline inside the border-box with zero layout impact, so padding, width and border-radius all stay exactly as designed. A real border adds to the element box (even with border-box sizing it eats into content space) and shifts inner positions by its width. Shadows also follow transforms and zoom without reflowing anything.

Can box-shadow give a drop shadow to a transparent PNG?

No — box-shadow always shadows the rectangular border-box, never the picture's alpha silhouette, so a cut-out shape gets a shadowed square behind it. The sibling property for that job is filter: drop-shadow(8px 8px 6px rgba(0,0,0,0.4)), which follows the visible pixels of images and SVGs. It takes no spread value and always sits behind the element, but for stickers and logos it is the right tool.

How is text-shadow different?

text-shadow paints copies of the glyph shapes, not a box: it accepts offset-x, offset-y and blur but has no spread keyword at all, and it can be stacked comma-separated for glow effects like 0 0 8px. It follows the text itself — including ::first-line and ::first-letter — which is why the CSS this generator produces will not move any text shadow you already have.

Are box-shadow transitions cheap?

Animating box-shadow directly forces a repaint each frame, so hover effects on a few elements are fine but long lists of animated shadows can drop frames on weak hardware. The classic optimization is a pseudo-element holding the target shadow, transitioned with opacity, which the browser can often composite instead. Blurred layer count matters more than blur distance: three soft stacked layers still cost less live animation than one shadow you tween every frame.

Is anything uploaded to a server?

No. Every shadow here is computed in your browser from slider state and handed to your clipboard as plain CSS. There is no account, no storage and no network request involved, and the page keeps working with the network switched off.