CSS Box Shadow Generator

This free CSS box shadow generator builds soft, layered drop shadows for cards, buttons, and modals with a live preview — drag the element to set the offset, stack multiple shadows, and tune blur, spread, color, and opacity. Start from a Material, neumorphism, or glow preset, then copy the box-shadow as CSS or Tailwind.

Presets:

Shadow layers

The first layer paints on top. Drag the element on the preview to move the selected shadow. Max 8 layers.

Editing layer

Offset X

Offset Y

Blur

Spread

Color

Opacity

Element size

Border radius

Element color

Background

The background matters for light or white shadows and for neumorphism.

Live Preview
drag me

Syntax

x y blur spread color
The value order
inset
Shadow inside the box
a, b, c
Comma = multiple shadows
rgba(0,0,0,.15)
Soft, semi-transparent

Blur vs spread

Blur
Softens the edge
Spread +
Grows the shadow
Spread −
Shrinks / tucks under
Blur 0
Hard / sharp shadow

Layering

First on top
List order = paint order
Smooth shadow
Stack low-opacity layers
Material
2–3 layer recipe
Neumorphism
Light + dark on same bg

Good to know

No reflow
Doesn't affect layout
Glow
0 0 blur color
Tailwind
shadow-[…]
Clipping
Parent overflow:hidden cuts it

Frequently asked questions

box-shadow adds one or more shadows around an element. Each shadow takes an optional inset keyword, a horizontal and vertical offset, an optional blur radius and spread radius, and a color — for example box-shadow: 0 4px 12px rgba(0,0,0,0.15). It is painted outside the border box, so it never changes the element's size or pushes neighboring elements.
List several shadows separated by commas; each renders as its own layer, e.g. box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.1). The first shadow in the list is painted on top of the ones after it. Click Add layer in this generator to stack up to eight shadows.
The blur radius softens the shadow's edge — a larger blur makes it more diffuse, while 0 gives a hard edge. The spread radius changes the shadow's size before it is blurred: positive values grow the shadow outward and negative values shrink it, which is handy for tucking a shadow under a card so only the lower edge shows.
The inset keyword draws the shadow inside the element's box instead of outside it, creating an inner or pressed appearance. It's commonly used for input fields, wells, and pressed buttons. Toggle Inset on any layer in this tool to switch a shadow from outer to inner.
Skip a single heavy shadow. Stack two or more shadows with low opacity and progressively larger blur and offset — this layered approach, sometimes called smooth shadows, mimics how light actually falls off and looks far more natural. The Material and Layered presets above demonstrate the recipe.
Neumorphism uses two shadows on an element that's the same color as its background: a lighter shadow offset up and to the left, and a darker shadow offset down and to the right, which makes the surface look gently extruded. For a pressed variant, make both shadows inset. Use the Neumorphism preset here, which also matches the element and page colors for you.
Tailwind ships a shadow scale — shadow-sm, shadow, shadow-md, shadow-lg, shadow-xl, shadow-2xl, plus shadow-inner and shadow-none. For a custom shadow, use an arbitrary value such as shadow-[0_10px_15px_-3px_rgba(0,0,0,0.1)] (spaces as underscores). Multiple comma-separated shadows don't work as one arbitrary class, so apply those with the style attribute or a custom theme token — the Tailwind tab above outputs the right form automatically.
box-shadow is painted outside the layout box, so it never changes an element's size or pushes neighbors and can't cause reflow. If a shadow isn't visible, check that it has a non-zero offset, blur, or spread, that its color isn't fully transparent, that there's enough contrast with the background, and that a parent doesn't have overflow: hidden clipping it. box-shadow works unprefixed in every modern browser.
Both create a shadow, but they trace different shapes. box-shadow always follows the element's rectangular border box (rounded by any border-radius) and supports spread and inset. The filter: drop-shadow() function follows the element's actual alpha shape, so it's the right choice for transparent PNGs, SVG icons, and irregular cut-out shapes — but it has no spread or inset. For cards, panels, and buttons, reach for box-shadow (this generator); for a shadow that hugs a non-rectangular graphic, use filter: drop-shadow().