CSS Box Shadow Generator
Configure offset, blur, spread, colour and inset to get a ready-to-paste box-shadow rule. Optional layered mode emits a stack of progressively larger, softer shadows for a natural elevation look.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
A rule you can paste
Set the horizontal and vertical offset, the blur radius, the spread and a colour, and the tool writes a complete box-shadow declaration you can drop straight into a stylesheet. The result is the finished rule in CSS syntax, so there is nothing to assemble by hand and no chance of transposing the offset and blur values.
What each value does
Offset X and Y move the shadow relative to the element — a positive Y pushes it down, the usual "light from above" look. Blur softens the edge; 0 gives a hard copy of the box. Spread grows or shrinks the shadow before blurring, so a negative spread tightens it. Inset draws the shadow inside the element, which is how pressed and recessed surfaces are made.
Layered shadows for believable depth
A single shadow with a big blur looks flat and artificial. Raise Layers to 2–6 and the tool emits several shadows in one declaration, each with a fraction of the offset, blur and spread and a proportionally smaller alpha, so the stack builds a soft, natural elevation rather than a grey halo. The final layer uses the exact values you entered.
Colour and comma syntax
The colour accepts any CSS colour, but an rgba() value with partial alpha is what makes a shadow feel like light rather than paint — the default is a 15% black. Multiple layers are joined with commas inside the single declaration, which is legal CSS and supported everywhere, so the rule copies as one line.
Built locally
The declaration is pure string building in this tab — no design service is queried and no styles are uploaded. Your theme colours stay private, and the tool works offline once the page has loaded.
Questions
How does layered mode scale the shadows?
Layer i of N uses offset/blur/spread multiplied by i/N and the colour alpha divided by i. It mimics the multi-shadow "elevation" technique popularised by Material Design.
What does a negative spread do?
Spread grows the shadow before it is blurred, so a negative value shrinks it — the shadow hugs the element more tightly and reads as a crisper edge. It is the trick behind thin, precise borders of shadow.
Can I use any CSS colour format?
Yes, the colour field accepts hex, rgb(), hsl() and named colours, but a value with partial alpha such as rgba(0, 0, 0, 0.15) is what makes a shadow look like light instead of a grey band. Fully opaque colours tend to look heavy.
Related tools
See categoryCSS Gradient Generator
Build linear, radial and conic CSS gradients with custom colour stops.
Color Blender
Mix two colors in RGB or HSL space with a 0-100% blend ratio.
:nth-child An+B Evaluator
Parse CSS An+B (:nth-child, :nth-of-type) microsyntax, validate it, and list which child indices it matches.
.editorconfig Generator
Generate an .editorconfig with your indentation, line-ending and charset settings.