CSS Box Shadow Generator
Design layered CSS box shadows with inset, blur, spread and opacity. Preview locally, convert px/rem, copy CSS and save editable settings.
Shadow layers
Preview
Build and save a shadow
Edit each layer’s X/Y offset, blur, spread, color and opacity. The preview and CSS update immediately. Copy CSS into your stylesheet and replace .shadow with your selector. Copy JSON or Save settings keeps the complete editable setup; Load settings accepts that exported JSON.
For a hard shadow 8px to the right and 12px down, use box-shadow: 8px 12px 0px 0px #000000;. Increase blur to soften it or lower opacity to reveal the surrounding background. The presets offer layered elevation, a hard offset, inset lighting and an outline.
Understand the four length values
X and Y move the shadow horizontally and vertically; negative values move it left or up. Blur must be zero or positive. Spread grows or shrinks the shadow before blurring; a sufficiently negative spread can erase an outer shadow.
Inset moves the shadow inside the element. An outer box shadow follows the box’s border shape and is cut out beneath the box, even when the box background is transparent. Unlike filter: drop-shadow(), it does not follow the alpha silhouette of an image.
Layer order and transparency
The first listed shadow is on top of later shadows of the same kind. Move up / down changes that paint order; Duplicate makes an independent editable copy. Enabled removes a layer from CSS without deleting its settings. Disable every layer to generate box-shadow: none;. All saved layer values must still be valid.
Try the double outline to see how spread and order interact. Insets paint above the box background and outer shadows below it. Box opacity here changes only the preview background fill, not the opacity of the shadow or the entire element. Layer opacity changes only that shadow.
px, rem and the scaled preview
Switching between px and rem converts the lengths using the assumed root font size. Values round to three decimal places. Changing the root size while using rem changes the physical preview; the exported rem values stay unchanged. Use your page’s actual root size, and test browser zoom.
Preview dimensions, corner radius, box color/opacity and background are excluded from CSS. Set them to match your target element; a nonzero corner radius changes the shadow shape. Wide or soft shadows automatically shrink to fit the preview area, and the displayed scale makes this visible. Exported values retain their original size.
Limits, rendering and privacy
Use 1–8 layers. At the chosen root size, X/Y are limited to ±200px, blur to 0–120px and spread to ±100px; opacity is 0–100%. Root size is 8–32px, preview width 40–400px, height 40–320px and radius 0–200px. All numbers accept up to three decimal places. HEX inputs accept three or six digits.
Settings imports are limited to 32 KiB of UTF-8 JSON and are validated completely before application. A failed import keeps the current setup. Processing stays in your browser, with no upload or local-storage persistence.
The browser draws the actual CSS; this tool does not simulate blur with an image. Blur kernels and antialiasing can differ between browsers. Shadows do not reserve layout space, and an ancestor with overflow: hidden can clip them on your own page. Keep focus indicators and text contrast visible; a shadow alone does not establish an accessible boundary.
Related resources
Questions & answers
Why does a reordered layer look different?
CSS paints the first listed shadow above later shadows. A dark foreground layer can cover a softer colored layer. Inset and outer shadows also occupy different painting levels around the box background.
Does the preview corner radius appear in the CSS?
No. The export contains only box-shadow. Match the preview radius, dimensions and box background to your existing element, or set those properties separately in your stylesheet.
Why does a rem shadow look different on my website?
rem depends on the root element’s font size. Set the assumed root size to the value used on your page. Unit conversion rounds to three decimal places; changing the root after conversion changes the resulting pixel lengths.
Can I remove every shadow without losing the layers?
Yes. Uncheck Enabled on every layer to export box-shadow: none;. Disabled layers remain in the settings JSON. Editing, exporting and importing happen locally in your browser.
Other Languages
References
How we make sure
We check this tool with the automated test suites linked below. Example checks are shown in their original language.
- Verification method
- Compare actual generation/parsing results with explicit expected values, checking shadow ordering, alpha, disabled layers and none output.
- Comparison reference
- Authored CSS/parameter fixtures and boundary assertions; no second CSS layout engine.
- Verification scope
- These checks validate output/calculation rules, not rendering equivalence across all browsers.
Test source and cases (select a file to read it)
-
shadow-tools.test.js
- shadow: exact independent CSS syntax and alpha with immutable normalized input
- shadow: first layer stays first, disabled layers omit cleanly and all disabled exports none
These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.