01 / Sliders
Offset, blur, spread
Move the shadow across and down, soften it with blur, and grow or shrink it with spread.
Free tool
Shape a CSS box shadow with sliders for the offset, blur, spread and opacity, pick its colour, make it inset, and stack several layers for the soft, natural shadows modern designs use. Type exact numbers next to each slider, set the box colour, the page colour and the corner radius to see it in place, start from a preset or one of Tailwind's own shadow sizes, and copy the CSS or a Tailwind class. Copy link opens the same shadow anywhere.
Need a custom tool, app or website? Contact us →Tailwind sizes
Made in your browser. Nothing is sent anywhere.
Natural shadows
01 / Sliders
Move the shadow across and down, soften it with blur, and grow or shrink it with spread.
02 / Layers
A tight, light shadow plus a wide, soft one looks more like real light than one shadow.
03 / Copy
The box-shadow line and the radius, with rgba colours for the opacity.
Guide
A box shadow generator writes the CSS box-shadow line for you while you move sliders and watch a sample card. This one lets you set the offset, blur, spread, colour and opacity of each shadow, make it inset, and stack as many layers as you like. It also sets the corner radius, because a shadow follows the rounded corners of its box. You copy two lines of CSS: the shadow and the radius.
The Box and Page colours are only there for the preview, so you can judge the shadow on your real colours. They are not part of the copied code.
The default shadow gives you this code:
box-shadow: 0px 12px 32px -8px rgba(27, 27, 31, 0.18), 0px 2px 6px 0px rgba(27, 27, 31, 0.08);
| Value | Slider | What it does | Range here |
|---|---|---|---|
| 1st | Across | Moves the shadow right (positive) or left (negative) | -100 to 100 px |
| 2nd | Down | Moves it down (positive) or up (negative) | -100 to 100 px |
| 3rd | Blur | Softens the edge. 0 is a hard edge | 0 to 200 px |
| 4th | Spread | Grows or shrinks the shadow on every side before the blur | -100 to 100 px |
| Colour | Colour and Opacity | Written as rgba(), or as a hex colour at 100% | 0 to 100% |
Take the first layer: 12 pixels down, 32 blur, minus 8 spread. The spread shrinks the shadow by 8 pixels on every side. Moving it 12 down then puts its top edge 20 pixels inside the box (8 plus 12) and its bottom edge 4 pixels below the box (12 minus 8). The sides stay 8 pixels inside. Before the blur, the shadow only peeks out at the bottom. The 32 pixel blur then softens it outward, so you see a soft shadow mostly below the card and almost none at the top. That is how light from above looks.
The second layer, 2 pixels down with a 6 pixel blur at 8% opacity, adds a thin, crisp line close to the edge. Together they look like a card resting on a surface, not floating.
The xs to 2xl buttons load the values Tailwind CSS v4.3 uses for shadow-xs to shadow-2xl, so you can start from a size you already use and adjust it. md, for example, is 0 4px 6px -1px plus 0 2px 4px -2px, both black at 10% (Tailwind CSS docs, checked 18 Oct 2026). Code as a Tailwind class writes your shadow as shadow-[...] with underscores for spaces, plus rounded-[...] for the corner radius.
overflow: hidden.box-shadow follows the rectangle, not the shape. Use filter: drop-shadow() for that instead.For the background behind your card, try the CSS gradient generator. Check that the text on the card is easy to read with the colour contrast checker, and turn a hex colour into the RGB numbers you need with HEX to RGB.
Questions
Move the sliders until it looks right, then press Copy code.
It grows (positive) or shrinks (negative) the shadow before the blur. A negative spread keeps a soft shadow tucked under the box.
A shadow inside the box, so it looks pressed in.
Real shadows are sharp near the object and soft further away; layers copy that.
Your last design is kept in this browser.
Give it a positive Down value and a negative Spread about the same size as the blur, with Across at 0. The spread pulls the sides and top in, so the shadow only shows below.
Yes. Separate them with commas in one box-shadow line. Press Add a shadow layer here and the tool writes the list for you.
box-shadow follows the element's box and its rounded corners, and it can have spread and inset. filter: drop-shadow() follows the visible shape, such as a transparent PNG or an SVG icon.
Check the opacity and that the shadow colour is not the same as the page. A parent with overflow: hidden can also cut it off.