Box Shadow Generator

Build a box-shadow with multiple stacked layers, inset support and presets, then copy the CSS.

Loading tool…

The shadow is rendered by your browser from the values on this page. Nothing is uploaded.

What the Box Shadow Generator does

The box shadow generator on this page will build a box-shadow with multiple stacked layers, inset support and presets, then copy the CSS. Everything runs inside this page, so the work happens on your own device rather than on a server. It is most often used for building an elevation scale for a design system. Companion tools to this one live on FreeToolsWorld.org.

How to use it

  1. Adjust offset, blur, spread and colour for the selected layer.
  2. Add a second or third layer — that is what makes a shadow look real.
  3. Try a preset as a starting point.
  4. Copy the CSS.

How it works

A single box-shadow reads as a flat drop shadow from a decade ago. What looks like depth is two or three layers at different blurs and opacities: a tight, nearly opaque one that grounds the element against its background, and a wider, fainter one that suggests the distance it is lifted. That is how every well-regarded design system builds elevation, and it is tedious enough to write by hand that most people never try it.

The four numbers do distinct jobs. Horizontal and vertical offset move the shadow; in most interfaces the horizontal stays at zero because the implied light source is directly above. Blur softens the edge. Spread grows or shrinks the shadow before blurring — a negative spread on a wide blur is the trick that produces a soft shadow which does not bleed out past the element.

Opacity matters more than colour. Shadows are convincing at low alpha — around 0.05 to 0.1 for a resting card and 0.15 to 0.25 for something genuinely lifted — and a pure black shadow at high opacity looks like a sticker. A shadow tinted slightly towards the background hue reads as more natural than neutral black, which is why the defaults here use a dark blue-grey rather than #000.

Inset turns the shadow inwards, which is how you make a pressed button, an inset well or a subtle inner border. It is also the honest way to suggest something is recessed rather than raised, and it costs nothing extra since it is the same property.

When to use it

  • Building an elevation scale for a design system.
  • Making a card or dropdown look lifted off the page.
  • Creating a pressed or inset state for a control.
  • Matching a shadow from a design file.

Common mistakes to avoid

  • Using one layer at high opacity, which looks flat and dated.
  • Pure black shadows. A dark tint of the background hue looks far more natural.
  • Large blurs without a negative spread, which makes the shadow bleed well past the element.

Frequently asked questions

Why do my shadows look fake?

Almost always one layer at too high an opacity. Real depth comes from two or three layers — a tight dark one and a wide faint one — at alpha values around 0.06 to 0.2.

What does spread do?

It grows or shrinks the shadow before the blur is applied. A negative spread with a large blur gives a soft shadow that stays close to the element instead of spreading across the page.

How do I make an inner shadow?

Tick inset. The same four values then apply inside the element instead of outside, which is how pressed buttons and inset wells are made.

Related tools

See all developer tools →