CSS Box Shadow Generator

Build a box-shadow from one or more layers and see it on a card as you go. Each layer has its own offset, blur, spread, colour and opacity, and can be an inner (inset) shadow. Several soft layers look far more natural than one big blur, so the presets include a smooth layered shadow ready to use.

Preview background
Presets
Layers (5)

The first layer is drawn on top. Several soft layers look more natural than one big blur.

Code
box-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.04), 0 4px 8px 0 rgb(0 0 0 / 0.04), 0 8px 16px 0 rgb(0 0 0 / 0.04), 0 16px 32px 0 rgb(0 0 0 / 0.04), 0 32px 64px 0 rgb(0 0 0 / 0.04);

Generating runs in your browser. What you type never leaves this device.

Features

  • Up to 30 layers; reorder, remove or edit each one

  • Offset, blur, spread, colour, opacity and inset per layer

  • Presets: soft, smooth (layered), card, floating, hard offset, inner and glow

  • Preview on light, dark or transparent backgrounds with your own box colour and corner radius

  • Copy as CSS or as a Tailwind shadow-[...] class

Shadows people make here

Cards and modals

Lift a card off the page with a soft, layered shadow instead of a harsh grey edge.

Buttons and inputs

A small shadow for raised buttons, or an inset shadow for pressed buttons and input fields.

Neo-brutal and retro styles

A hard offset shadow with no blur gives the bold, flat look used by many new startups.

Making shadows look natural

What each setting does

  • Across and down move the shadow. Positive down puts it below the box, as if lit from above.
  • Blur softens the edge. Zero gives a hard, solid shadow.
  • Spread grows or shrinks the shadow before blurring; negative spread keeps a big blur tucked under the box.
  • Inset draws the shadow inside the box, so it looks pressed in.

Why layered shadows look better

Real shadows are dark and sharp close to an object and fade out softly further away. One box-shadow cannot do that, but stacking several with doubling offset and blur can. The "Smooth (layered)" preset does this with five layers whose opacity adds up to about 22%.

Tips

  • Keep shadow colours dark and see-through (black at 5 to 25%), or use a dark version of the background colour for a richer look.
  • On dark backgrounds, shadows barely show; use a lighter border or a glow instead.
  • Animate transform rather than box-shadow for smooth hover effects on slow phones.

Related tools

CSS Box Shadow Generator - FAQ