Developer tool

CSS box-shadow generator

Drag the sliders and copy the CSS.

CSS box-shadow generator Runs on your device
  • Runs in your browser — your text is never sent anywhere
  • No sign-up, no quotas, free to use as often as you like

How it works

Box-shadow takes four numbers and a colour in a specific order, and the difference between a shadow that reads as depth and one that reads as a sticker is entirely in those numbers. Seeing it change as you drag is much faster than guessing.

What the four numbers mean

In order: horizontal offset, vertical offset, blur radius, and spread. Offsets move the shadow; blur softens its edge; spread grows or shrinks it before blurring. A negative spread pulls the shadow in, which is how you get a tight shadow under a card without it bleeding out at the sides.

Making it look real

Light usually comes from above, so a small positive vertical offset with no horizontal offset reads as natural. Large, very transparent shadows read as soft depth; small, dark, sharp ones read as a cut-out sticker. Real objects cast shadows that are blurrier the further they are from the surface — a bigger blur implies a higher element.

Inset shadows

An inset shadow is drawn inside the element instead of outside, which is how pressed buttons, input fields and inset panels are made. The same four numbers apply, just pointing inwards.

Several shadows at once

CSS accepts a comma-separated list, and layering two — one tight and dark, one wide and faint — looks considerably better than a single one. This generator produces one; paste two together yourself for the layered effect.

FAQ

CSS box-shadow generator — questions

What order are the values in?

Horizontal offset, vertical offset, blur, spread, then colour.

What does a negative spread do?

It shrinks the shadow before blurring, which keeps it tight under an element instead of bleeding out at the sides.

What is an inset shadow?

One drawn inside the element rather than outside — used for pressed buttons and input fields.

Can I make a layered shadow?

Not directly. CSS accepts a comma-separated list, so generate two and paste them together.