Skip to content
ToolZone

Box Shadow Generator

Visually design a CSS box shadow, adjusting offset, blur, spread, and color with live preview, then copy the generated CSS code.

Runs in your browser. Nothing you enter or upload leaves your device.

box-shadow: 0px 4px 12px -2px rgb(0 0 0 / 15%);

Keyboard shortcuts

Run the main action
⌘ / Ctrl + Enter
Copy the result
⌘ / Ctrl + Shift + Enter
Download the result
⌘ / Ctrl + S
Paste a file or image into file tools
⌘ / Ctrl + V
Search all tools
⌘ / Ctrl + K
Show these shortcuts
?

You can also drop files anywhere on the page.

About the Box Shadow Generator

The Box Shadow Generator lets you shape a CSS shadow with sliders instead of guessing pixel values. A white card in the preview shows the shadow as you adjust it, and the matching box-shadow declaration is ready to copy.

How it works

A CSS box-shadow takes up to four lengths and a color: horizontal offset (X), vertical offset (Y), blur radius, and spread radius. The generator writes them in that order in pixels, so the default is box-shadow: 0px 4px 12px -2px rgb(0 0 0 / 15%); a soft shadow that drops slightly below the card. Positive X moves the shadow right, positive Y moves it down, and a negative spread shrinks it so it peeks out mainly at the bottom.

The color is written as rgb() with an opacity percentage from the Opacity slider, so the color and its transparency can be set separately. Blur runs from 0 to 100, since CSS doesn't allow a negative blur. Ticking Inset adds the inset keyword, which draws the shadow inside the box instead of outside.

How to use

  1. 1

    Drag the X and Y sliders to set which direction the shadow falls.

  2. 2

    Use the Blur slider to soften the edge and the Spread slider to grow or shrink the shadow.

  3. 3

    Click the color swatch and set Opacity, tick Inset for an inner shadow, or start from a preset such as Card or Glow.

  4. 4

    Click Copy to copy the box-shadow declaration.

Worked examples

Default card shadow

A subtle shadow for content cards.

Input
X 0, Y 4, Blur 12, Spread -2, black at 15%
Result
box-shadow: 0px 4px 12px -2px rgb(0 0 0 / 15%);

Inner shadow for an input

Making a text field look slightly recessed.

Input
Inset on, X 0, Y 2, Blur 4, Spread 0, black at 12%
Result
box-shadow: inset 0px 2px 4px 0px rgb(0 0 0 / 12%);

Colored glow

A blue glow around a focused button.

Input
X 0, Y 0, Blur 20, Spread 4, color #2563eb at 25%
Result
box-shadow: 0px 0px 20px 4px rgb(37 99 235 / 25%);

#2563eb is rgb(37, 99, 235); the Opacity slider adds the / 25% part.

Limitations
Offsets and spread run from -50 to 50 px and blur from 0 to 100 px. Colors are output as rgb() with a percentage alpha, which all current browsers support; very old browsers need rgba() instead. Only one shadow layer is generated at a time.
Assumptions
Values are in pixels. The shadow is applied to an element with a visible background, like the white card in the preview.
Privacy
The shadow is generated in your browser, and no settings are sent or stored.

Frequently asked questions

What does the spread value control?+

Spread grows (positive) or shrinks (negative) the shadow before it is blurred, independent of the blur amount. A negative spread keeps the shadow tucked under the element.

Can I add multiple shadows to one element?+

CSS allows it by separating values with commas. This tool designs one shadow at a time, so create each layer, copy it, and join them in your stylesheet.

What does the Inset option do?+

It adds the inset keyword, which draws the shadow inside the element's border, making it look pressed in rather than raised.

Why is my shadow not showing in the browser?+

Check that Opacity isn't 0, that the element has a background, and that it isn't clipped by overflow: hidden on a parent. An inset shadow only shows inside the element.

How do I change the shadow's transparency?+

Use the Opacity slider. It writes the alpha as a percentage, for example rgb(0 0 0 / 15%), where 0% is invisible and 100% is solid.

Related tools