CSS box-shadow generator
Build a CSS box-shadow value from offset, blur, spread and color, with multiple layers and presets.
CSS box-shadow generator
Adjust horizontal and vertical offset, blur radius, spread radius and color, and this tool assembles the matching box-shadow declaration as you go. It is built for the everyday case — a card, a button, a modal that needs to lift off the page — as well as for layered shadows made of several shadows stacked together, the technique behind the soft, realistic depth used in most modern design systems.
The preset dropdown offers subtle, medium and strong elevation, each with its own layer count, offset and blur already tuned; pick custom to drive every value yourself. The layers option controls how many shadows stack: each added layer grows the offset and blur by its index and fades its opacity, turning a single flat shadow into a soft, convincing one. Inset flips the shadow inward for pressed elements, opacity controls how strong the color reads, and the unit switch outputs px or rem. Turn on the dark mode variant for a second, stronger declaration wrapped in an @media (prefers-color-scheme: dark) block — a shadow needs more opacity to stay visible on a dark background. Choose whether the result comes out as a single line, a --box-shadow custom property, or a .box-shadow class, and add a matching filter: drop-shadow line for elements a box-shadow can't reach, such as an SVG icon or a transparent PNG.
Every value is clamped to a sane range, and an unrecognized color falls back to black rather than broken CSS, so the output always pastes cleanly into a stylesheet.
Everything runs in your browser as you adjust the controls — no color or generated CSS is ever sent anywhere. Copy the result, download it as a .txt file, or send it into another tool to keep working on it.