Search tools

Box Shadow Generator

Stack one or more shadow layers, see them on a live card, and copy the box-shadow CSS.

Box Shadow Generator tool

Presets
Layers are drawn top to bottom: the first one sits on top.

Processing runs in your browser.

Shadows tell people what sits above what. A card that casts a soft shadow looks clickable; a menu with a stronger one clearly floats over the page. Getting that right by typing numbers into CSS is slow, because every value interacts with the others. This tool shows each change on a live box straight away.

How a shadow is built

Every layer has the same parts, in the order CSS expects them:

  1. X and Y offset: how far the shadow moves right and down. Light usually comes from above, so Y is positive.
  2. Blur: how soft the edge is. Zero gives a hard, graphic shadow.
  3. Spread: grows or shrinks the shadow before blurring.
  4. Colour and opacity: shadows look most natural in a dark, slightly tinted colour at low opacity, around 8–20%.

Example uses

  • Cards and tiles: the Card preset gives a quiet edge that works on white backgrounds.
  • Modals and popovers: the Floating preset adds depth so the panel separates from the page.
  • Pressed or input states: an inset shadow makes a field look sunken.
  • Bold, flat styles: the Hard offset preset gives a sharp, poster-like shadow with no blur.

Matching dark mode

Shadows almost vanish on dark backgrounds. In dark themes, designers often lighten the surface of raised elements instead, or use a faint light border. Switch the preview background to a dark colour to judge how your shadow holds up.

How to use the Box Shadow Generator

  1. Start from a preset such as Soft, Floating or Neumorphic.
  2. Adjust each layer’s X and Y offset, blur, spread, colour and opacity.
  3. Tick Inset for a shadow inside the box, like a pressed button.
  4. Add layers with + Add layer and reorder them with the arrow button.
  5. Change the background, box colour and corner radius to match your design, then click Copy CSS.

Features

  • Unlimited layers, combined into one box-shadow declaration.
  • Opacity per layer, written as modern rgb(r g b / a) colours.
  • Seven presets, including a smooth five-layer shadow and a neumorphic pair.
  • Live preview with adjustable background, box colour and border radius.
  • Inset shadows and negative spread for tight, realistic edges.

Frequently asked questions

Why use several shadow layers instead of one?

Real shadows are dark and sharp close to an object and soft further away. Stacking two to five layers with growing blur and offset copies that, so the box looks like it floats rather than having a grey halo.

What does spread do?

Spread grows or shrinks the shadow before it is blurred. A negative spread with a larger Y offset gives a shadow that only shows below the element, which is common for cards and dropdowns.

Do box shadows hurt performance?

A few static shadows are fine. Animating large blurred shadows can cause jank on slow devices; instead, put the shadow on a pseudo-element and animate its opacity.

How do I make a neumorphic shadow?

Use the Neumorphic preset: a darker shadow offset down and right, and a lighter one offset up and left, on a background the same colour as the box. Keep contrast in mind, as the effect is subtle by design.

Written by