Generate CSS Box Shadows with Live Preview
Build a CSS box shadow with offset, blur, spread, and opacity sliders, and copy the code.
- No upload
- No signup
- Free
Loading tool…
Your file stays in this browser. Nothing is uploaded.
Loading tool…
Your file stays in this browser. Nothing is uploaded.
How CSS Box Shadow Generator works
Browser Toolset CSS Box Shadow Generator builds a single-layer drop shadow client-side. Tune the X/Y offsets, blur radius, spread, and shadow opacity with sliders, then copy the CSS.
How to use this tool
- Adjust the Horizontal (X) and Vertical (Y) offset sliders.
- Tune the Blur radius slider to soften or sharpen shadow edges.
- Adjust the Spread slider to expand or contract shadow coverage.
- Set the shadow opacity (the shadow color is black).
- Click "Copy CSS" to paste the generated box-shadow property.
Common uses
- UI designers crafting modern elevation tiers for cards and modals.
- Frontend engineers designing interactive button hover and focus states.
- Web designers building soft card and button shadows.
- Theme developers choosing drop-shadow values for depth tokens.
Frequently asked questions
What makes a CSS box shadow look modern and realistic?
Realistic shadows usually combine low opacity, a generous blur radius and a small positive vertical offset, which suggests light from above. This tool's default is 0 10px 25px -5px at 15% black, and the sliders let you tune each value.
Can I create inner (inset) shadows?
Not with a toggle. The tool generates outer shadows only. To make an inner shadow, copy the CSS and add the word inset at the start of the box-shadow value.
Are my style settings saved on a server?
No. The shadow CSS is generated in your browser and your settings are not uploaded. The tool does not save them, so reloading the page returns the sliders to their defaults; copy the CSS first.
Does the output include Tailwind CSS classes?
No. The tool copies standard CSS only, as a box-shadow line with a black rgba color. You can reuse the values in Tailwind with an arbitrary value such as shadow-[0_10px_25px_-5px_rgba(0,0,0,0.15)].
Can I preview the shadow against both light and dark backgrounds?
There is one preview panel that follows the site's light or dark theme, and no toggle to switch the preview background. The shadow color is always black, so paste the CSS into your own page to test it on other backgrounds.
Details and limits
Soft shadows with low opacity are a common way to suggest elevation in modern web design. Our CSS Box Shadow Generator lets you dial in a soft single-layer shadow with live sliders.
What one shadow contains
The shadow is built and previewed in your browser. Nothing is uploaded or saved. The output is a single box-shadow declaration in this order: horizontal offset, vertical offset, blur, spread and color. The page opens with 0px 10px 25px -5px rgba(0, 0, 0, 0.15).
The color is always black, and only its opacity changes. The slider's 0 to 100 becomes 0 to 1 in the rgba value, so 15 becomes 0.15. Copy CSS copies the whole line, starting with box-shadow: and ending with a semicolon.
Features and limits
- Ranges: X and Y offsets from -50 to 50 pixels, blur from 0 to 100, spread from -50 to 50, and opacity from 0 to 100 percent. All are whole numbers. A positive X moves the shadow right and a positive Y moves it down.
- A negative spread pulls the shadow inward, which keeps it from showing as a halo at the sides of the element.
- Not available: an inset option, a color picker, multiple layers, a light or dark preview switch and Tailwind output. To stack layers, copy the value several times and join them with commas by hand.
- Zero values are written with px, as in 0px. That is valid CSS.
- The preview card is white in light mode and dark in dark mode, on a gray panel. A faint black shadow can be hard to see in dark mode, so judge it against your real background.
Tips for natural-looking shadows
A small elevation uses a small Y offset and blur, for example 2 and 6. Raise the Y offset and blur together for higher elevation and keep the opacity low so the shadow stays soft.
On dark backgrounds a black shadow at low opacity can vanish. Raise the opacity, or replace rgba(0, 0, 0, x) with your own color in the copied line. The Color Code Converter can give you the rgb() form of a HEX color.
Shadows follow the element's border-radius, so give your element the same rounded corners as the preview card. For a frosted card use the CSS Glassmorphism Generator, and for a colored backdrop the CSS Gradient Generator.