CSS

CSS Box Shadow Generator

This CSS box shadow generator builds production-ready shadows with visual sliders for offset, blur, spread, color and the inset keyword. Stack unlimited shadow layers to create Material-style elevations, neumorphic surfaces, neon glows, or soft ambient lighting. Every change updates the live preview and rewrites the CSS in real time, so you can copy the finished declaration straight into your stylesheet. Pick a preset to start fast, or dial in custom values on both axes. All calculation runs in your browser — no sign-up, no tracking, works offline once the page is cached.

Last updated: March 2026
0px
8px
24px
0px
Copied!

Frequently Asked Questions

What does each value in a CSS box-shadow mean?
The box-shadow property takes up to six values: horizontal offset, vertical offset, blur radius, spread radius, color, and an optional inset keyword. Positive h-offset moves the shadow to the right; positive v-offset moves it down. Blur softens the edge — a blur of 0 creates a hard-edged shadow, while larger values create a diffuse gradient. Spread grows or shrinks the whole shadow uniformly before blurring. The inset keyword paints the shadow inside the element instead of outside.
Can I stack multiple box-shadows on one element?
Yes — separate each shadow with a comma inside a single box-shadow declaration. The first shadow renders on top of the next, so layer your sharp, close shadows first and softer, wider shadows after. Stacking is how designers achieve Material Design elevations (typically three layers: ambient, key, and contact), neumorphic surfaces (one light and one dark shadow from opposite directions), and realistic ambient lighting. This generator supports as many layers as you need — use the + Add layer button to create a new one.
What is the difference between inset and outer shadows?
An outer shadow (the default) paints outside the element's border, giving a sense of elevation above the page. An inset shadow paints inside the element, creating a recessed or pressed-in look. Inset shadows are commonly used for input fields, pressed button states, inner glows on cards, and simulating depth inside a container. You can mix inset and outer shadows on the same element by comma-separating them — for example, combining a soft outer shadow with a subtle inset highlight at the top edge creates a convincing "lifted" effect.
Do box-shadows affect layout or performance?
Shadows do not affect layout — they are painted outside the box model and do not push neighboring elements. However, large blur radii or many stacked shadows can hurt paint performance, especially on mobile devices with weaker GPUs. For animated shadows, prefer the will-change: box-shadow hint, or animate a pseudo-element's opacity instead of the shadow property itself to keep the animation on the compositor thread. Avoid animating the blur radius on every frame.
How do I make a soft, realistic shadow?
Realistic shadows use low opacity (rgba alpha between 0.08 and 0.2), a small vertical offset, and a generous blur. Try stacking two or three layers: a tight near shadow for contact with the surface, a medium blur for body depth, and a wide soft blur for ambient light. Avoid pure black — a slightly tinted dark color (for example rgba(17, 24, 39, 0.15)) reads as more natural because real-world shadows pick up ambient color tint. The Paper and Soft presets above demonstrate this layered approach.
Does box-shadow follow border-radius?
Yes. A box-shadow automatically traces the element's border-radius, so a rounded card gets a rounded shadow without any extra work. This is different from filter: drop-shadow(), which follows the actual painted shape including transparent PNG edges. Use box-shadow for rectangular and rounded-rectangular elements; use drop-shadow for irregular shapes, SVG icons, or elements with transparent cut-outs.