CSS Box Shadow Generator

Visually design a CSS box-shadow and copy the exact code.

100% Free · No Sign-up · Runs in Your Browser

About the CSS Box Shadow Generator

The CSS box-shadow property has five different numeric values plus a color, and getting a shadow that looks natural and appropriately subtle (rather than harsh or cartoonish) usually takes several rounds of trial and error when writing the values by hand. This generator lets you visually adjust every parameter with live sliders and instantly copy the resulting CSS.

This tool is useful for front-end developers adding depth to cards, buttons, and modals, designers prototyping realistic elevation effects for a design system, and anyone wanting a specific shadow look without repeatedly guessing and checking values in browser dev tools.

To use it, adjust sliders for horizontal offset, vertical offset, blur radius, spread radius, and shadow color/opacity — a live preview card updates instantly showing exactly how the shadow will look. Toggle "inset" for an inner shadow effect, and add multiple shadow layers for more complex, realistic depth effects (a common technique used in modern design systems to simulate soft, layered elevation).

For example, a subtle card shadow might use a small vertical offset (2px), moderate blur (8px), no spread, and a low-opacity black color — producing a soft, barely-there lift effect appropriate for a clean, modern UI card, while a more dramatic modal shadow might use a larger offset and blur with slightly higher opacity to visually separate it clearly from the page content behind it.

A common mistake is using shadow values that are too dark or too sharp (high opacity with low blur), which can look dated and heavy rather than the soft, subtle elevation effect most modern interfaces aim for — generally, larger blur radius values combined with lower opacity produce a more natural, contemporary look. Another frequent technique many designers overlook is layering two or three shadows with different offsets and blur values together, which more accurately simulates how real-world light and shadow behave than a single flat shadow value, adding a subtle but noticeable realism to elevated UI elements.

Tip: keep shadow direction consistent across your entire interface (for example, always assuming a light source from the top-left) so that all shadows across different components feel like part of one coherent lighting system rather than looking randomly generated on a per-component basis.

Frequently Asked Questions

Q.What does the spread radius control?

It expands or contracts the shadow's size in all directions before blurring is applied, distinct from blur radius which only softens the edges.

Q.What does inset do?

It flips the shadow to render inside the element's border instead of outside, creating an inward, pressed-in appearance.

Q.Can I combine multiple shadows on one element?

Yes, add multiple shadow layers with different values, separated by commas in the final CSS, to create more realistic layered depth.

Q.Why does my shadow look too harsh?

High opacity combined with low blur typically looks harsh and dated; increase blur and reduce opacity for a softer, more modern effect.

Q.Is the generated CSS supported in all browsers?

Yes, box-shadow is a well-established CSS property supported by all modern browsers.

Related Tools