CSS Box Shadow Generator
Generate multi-layer CSS box shadows with interactive preview, dark mode canvas, and Tailwind classes.
Runs in your browser. Nothing you add is uploaded.
What the CSS Box Shadow Generator does
Build a CSS box-shadow from up to five layers, see it live on a sample card against a light or dark background, and copy either the CSS value or a Tailwind arbitrary class. Each layer has its own X and Y offset, blur, spread, colour, opacity, inset switch and visibility toggle, which is how natural-looking shadows are made: a small, sharp shadow where the card meets the surface plus a large, soft one for ambient light. Five presets (subtle card, floating elevation, neon glow, neumorphic and dual rim) give you a starting point.
How to build a layered box shadow
- Pick a preset or start from the default layers.
- Select a layer and adjust its X and Y offset, blur, spread, colour and opacity; switch on Inset for an inner shadow.
- Add a layer (up to five), hide one with the eye icon to compare, or delete it.
- Switch the preview background between light and dark to check the shadow on both.
- Copy the CSS box-shadow value or the Tailwind shadow-[…] class.
The CSS Box Shadow Generator runs entirely in your browser — nothing you enter is uploaded, stored, or logged.
When to use it
Elevation levels for a design system
Cards, menus and dialogs read as sitting at different heights when their shadows grow with elevation: more Y offset and blur for higher surfaces, with opacity kept low. Building each level here and saving the values as tokens such as shadow-sm, shadow-md and shadow-lg keeps every component consistent.
Shadows that still work in dark mode
A black shadow almost vanishes on a dark background, which the dark preview shows straight away. Common fixes are a slightly stronger opacity, a faint 1px light ring (a layer with 0 offset, 0 blur, 1px spread and low-opacity white), or a lighter surface colour for raised elements.
Focus rings and glows
A layer with no offset and no blur but a 2–3px spread draws a crisp ring that, unlike a border, does not change the element's size; many focus styles are built this way. Several zero-offset, coloured, blurred layers make a glow.
Good to know
- Negative spread pulls the shadow in from the edges so a large blur doesn't spill out sideways; the Floating Elevation preset pairs a 25px blur with −5px spread.
- For everyday UI, keep black shadows at roughly 5–15% opacity. Heavier shadows look dated and muddy.
- In the Tailwind class, spaces in the value are written as underscores, which Tailwind turns back into spaces.
- Inset shadows are drawn inside the border and are the basis of pressed buttons and recessed inputs.
- Shadows never affect layout, so adding one never moves the elements around it.
Frequently asked questions
Why use multi-layer box shadows instead of a single shadow?
Can I use the output in Tailwind CSS?
What does the spread radius do in box-shadow?
Can box-shadow affect performance?
Page last updated . Found a wrong result or a mistake on this page? Let us know.
Related tools
Regex Builder
Build a regular expression from blocks, with live matches.
SQL Formatter
Put each SQL clause on its own line, or minify to one line.
JSON to YAML Converter
Convert JSON to YAML and back, with clear error locations.
Chmod Permissions Calculator
Work out chmod values from checkboxes, octal or ls -l strings.