Smooth Box Shadow Generator (Layered CSS Shadows)

Build realistic layered CSS box-shadows with curve, blur and opacity controls, live light/dark preview and copy-ready CSS or Tailwind code.

Smooth CSS shadows: why stack several layers

A single CSS shadow looks flat and harsh. Stacking 3 to 8 shadows whose offset and blur grow along a curve mimics how real light diffuses. Each layer carries a fraction of the total opacity.

Formula

For layer i out of N, with f = i / N and p = curve(f): vertical offset = distance × p, blur = final blur × p, opacity = total opacity / N. The curve is f (linear), f² (ease-in) or 1 − (1 − f)² (ease-out).

Example

5 layers, distance 32 px, blur 64 px, opacity 40%, ease-out curve: the offsets are 12, 20, 27, 31 and 32 px, the blurs 23, 41, 54, 61 and 64 px, and each layer has an opacity of 0.08.

  • Linear: even progression.
  • Ease-in: tight shadow near the card, diffuse farther out.
  • Ease-out: wide shadow from the first layers.

Limits

Many layers with a large blur cost rendering time on mobile: stay at 5 layers for card-heavy pages. The shadow is generated downwards only; a side shadow needs a horizontal offset added by hand.

Sources and dates: the CSS box-shadow property accepts several comma-separated shadows, which is the basis of the effect. The split of offsets, blurs and opacity across layers follows the tool's own method (linear, ease-in, ease-out curves), not a standard: it is an indicative aesthetic setting, not a sourced value. The Tailwind shadow-[…] syntax with underscores in place of spaces is Tailwind CSS's arbitrary-value notation (checked on 14/10/2026)

Frequently Asked Questions

How do I make a smooth, realistic CSS shadow?

Stack 4 to 6 box-shadows whose offset and blur roughly double with each layer, using a low opacity (0.04 to 0.1 per layer). The total opacity stays around 0.2 to 0.4.

How many shadow layers should I use?

3 to 6 layers are enough in most cases. Beyond 8, the visual gain is almost nil and rendering costs more on mobile.

How do I use this shadow with Tailwind CSS?

Use the arbitrary value syntax shadow-[…] with every space replaced by an underscore (_). The generator outputs the class ready to paste into your HTML.

Is this tool really free?

Yes, all tools on Kristools are 100% free and accessible without registration.

Is my data protected?

Yes. All processing is performed directly and securely inside your browser. No personal data is sent to our servers.