Black Friday: 50% off every paid plan with code BF50. Ends 5 December.

See prices

Free tool

Box shadow generator, soft, sharp or layered.

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

Layers look more real.

01 / Sliders

Offset, blur, spread

Move the shadow across and down, soften it with blur, and grow or shrink it with spread.

02 / Layers

Stack them

A tight, light shadow plus a wide, soft one looks more like real light than one shadow.

03 / Copy

Ready CSS

The box-shadow line and the radius, with rgba colours for the opacity.

Guide

How to make a CSS box shadow, one value at a time.

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.

How to use the box shadow generator

  1. Start from a preset, Soft, Layered, Sharp, Glow, Inset or Soft UI, one of the Tailwind sizes (xs to 2xl), or keep the default two layer shadow.
  2. For each shadow, move Across and Down to shift it, Blur to soften it, and Spread to grow or shrink it. Type in the box next to a slider for an exact value, including values past the slider's ends.
  3. Set its Opacity and pick its colour. Tick Inset to put the shadow inside the box.
  4. Press Add a shadow layer to stack another one, or Remove to drop a layer.
  5. Set the Box and Page colours to match your design, and the Corner radius.
  6. Choose Code as CSS or Code as a Tailwind class, press Copy code and paste it into the rule or the class list for your card, button or image. Copy link copies an address that opens this exact shadow.

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 four numbers in a shadow

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);

ValueSliderWhat it doesRange here
1stAcrossMoves the shadow right (positive) or left (negative)-100 to 100 px
2ndDownMoves it down (positive) or up (negative)-100 to 100 px
3rdBlurSoftens the edge. 0 is a hard edge0 to 200 px
4thSpreadGrows or shrinks the shadow on every side before the blur-100 to 100 px
ColourColour and OpacityWritten as rgba(), or as a hex colour at 100%0 to 100%

A worked example: why the default looks tucked under

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.

Picking a style

  • Soft is one wide, faint shadow for cards and panels.
  • Layered stacks three shadows that get bigger and softer, the most natural look for menus and dialogs.
  • Sharp is a solid offset shadow with no blur, for a bold, flat or retro style.
  • Glow uses a colour with no offset, for a highlighted button or a focus state.
  • Inset draws inside the box, for text fields and pressed buttons.
  • Soft UI pairs a dark shadow below right with a light one above left on a box the same colour as the page, the raised look often called neumorphism. It sets the Box and Page colours too. Check the contrast of anything on it, since the edges are faint by design.

Tailwind sizes and the Tailwind class

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.

Tips for shadows that look right

  • Keep opacity low. Real shadows are faint; most of the softness comes from a big blur, not a dark colour.
  • Tint the shadow. On a coloured page, a shadow in a darker shade of the page colour looks cleaner than grey.
  • Use the same direction everywhere. If one card's shadow goes down, they all should.
  • With several layers, the first one in the code is drawn on top. Put the tight, crisp layer first.
  • A shadow does not take up space, so it will not push other elements around. Leave enough padding around the box that the shadow is not cut off by a parent with overflow: hidden.
  • For a PNG with a transparent background, 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

Good to know.

How do I make a CSS box shadow?

Move the sliders until it looks right, then press Copy code.

What does spread do?

It grows (positive) or shrinks (negative) the shadow before the blur. A negative spread keeps a soft shadow tucked under the box.

What is an inset shadow?

A shadow inside the box, so it looks pressed in.

Why use several layers?

Real shadows are sharp near the object and soft further away; layers copy that.

Is it saved?

Your last design is kept in this browser.

How do I add a shadow to only the bottom of a box?

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.

Can I use more than one box shadow in CSS?

Yes. Separate them with commas in one box-shadow line. Press Add a shadow layer here and the tool writes the list for you.

What is the difference between box-shadow and drop-shadow?

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.

Why can I not see my shadow?

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.

Listed on

Listed on JustMacAppsMotionShine on Mac App IndexMotionShine on ScrollLaunchMotionShine featured on StartupBaseFeatured on FazierFeatured on Twelve ToolsMotionShine - Featured on Smol Launch