Box Shadow Generator
box-shadow syntax packs five values (horizontal offset, vertical offset, blur radius, spread radius, and color) into one line, and getting a subtle, realistic-looking shadow by guessing those numbers takes a lot of trial and error. This builds shadows visually, supports multiple stacked layers for more realistic depth, and outputs the exact CSS.
box-shadow: 0px 4px 24px -4px rgba(0, 0, 0, 0.12);How to use the Box Shadow Generator
- Adjust the sliders for horizontal offset, vertical offset, blur, and spread to shape your shadow.
- Pick a shadow color and set the opacity level.
- Add additional shadow layers for more depth or complex effects.
- Preview the result in real time on the preview card.
- Click the copy button to copy the generated CSS to your clipboard.
Why real shadows use more than one layer
A single box-shadow with a large blur often looks flat or artificial compared to real-world shadow behavior, where a surface actually casts two distinct effects: a tight, darker shadow close to the object, and a softer, lighter, more spread-out shadow further away. Stacking two box-shadow values (one tight and dark, one soft and light) mimics this and is the technique behind most of the convincingly "elevated card" shadows you see in modern UI design, a trick borrowed directly from Material Design's shadow system.
Frequently asked questions
What's the difference between blur and spread?
Blur radius softens the shadow's edges (larger = more feathered); spread radius expands or contracts the shadow's size before blur is applied, independent of the element's actual size.
Can I stack multiple shadows on one element?
Yes. Add multiple shadow layers and they're combined into a single comma-separated box-shadow declaration, which is exactly how CSS expects multiple shadows to be specified.
Does it support inset shadows?
Yes, toggle "inset" to generate an inward-facing shadow, useful for pressed-button or recessed-input effects rather than an elevated, floating look.
Related Tools
CSS Gradient Generator
Build beautiful CSS gradients visually with color stops, angles, and one-click copy.
Color Palette Generator
Generate complementary, analogous, triadic, and custom color palettes from any base color.
Color Converter
Convert colors between HEX, RGB, and HSL with a live preview.
Contrast Checker
Check WCAG AA/AAA color contrast compliance for any color pair.