Box Shadow Generator

Craft a CSS box-shadow with live sliders and preview, then copy the exact code — free and private.

Design a CSS box-shadow by eye

A shadow lifts a card, a button or a pop-up off the page, but writing box-shadow values by hand is mostly guesswork. Move the sliders for horizontal and vertical offset, blur, spread, colour and opacity, watch the preview box change, and copy one line of CSS that is ready to paste into your stylesheet. The recipes below give starting values for cards, buttons and modals, and explain the mistakes that make shadows look heavy or cut off.

How to create a box-shadow

  1. Adjust the horizontal and vertical offset sliders.
  2. Set the blur and spread to taste.
  3. Pick a shadow color and opacity.
  4. Copy the generated box-shadow CSS.

Features

  • Live preview of the shadow.
  • Full control: offset, blur, spread, color, opacity.
  • Clean, copy-ready CSS output.
  • Private and browser-based.
  • Free with no sign-up.

Making shadows that look natural

A good shadow is soft and subtle. Try something like:

box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);

  • Use low opacity. Values between 0.08 and 0.2 usually look best; strong black shadows look heavy.
  • Offset downwards a little, because light normally comes from above.
  • Increase blur with distance. A larger offset needs a larger blur to stay soft.
  • Layer two shadows (one small and sharp, one large and soft) for a more realistic effect.

Shadow recipes to start from

Most good shadows are soft and subtle. Use these settings as a starting point, then adjust to your design:

LookHorizontal / VerticalBlur / SpreadOpacity
Card resting on the page0 / 2 px8 / 0 px10–15%
Raised button on hover0 / 6 px16 / 0 px18–22%
Floating popup or modal0 / 16 px40 / -8 px25%
Thin outline without a border0 / 0 px0 / 1 px15%

Common mistakes

  • Too dark. A shadow at 50% or more looks heavy on a light background. Real shadows are faint.
  • Pure black on coloured sections. On a blue or green background, pick a darker shade of that colour instead of black for a more natural result.
  • Shadows on everything. Use them to show which items sit above others, such as cards, menus and dialogs, not on every element.
  • Negative spread pulls the shadow in under the element, which keeps a large blur from spreading out to the sides.

Your privacy

The shadow is previewed and the CSS is written by your own browser. Nothing is uploaded or stored.

Frequently asked questions

Can I make an inset shadow?

This tool creates outer shadows; add the inset keyword manually to the copied code if needed.

What is spread?

Spread expands or shrinks the shadow size before the blur is applied.

Is anything uploaded?

No, the Box Shadow Generator runs entirely in your browser.

What do the numbers in box-shadow mean?

In order: horizontal offset, vertical offset, blur, spread and colour. For example 0 10px 25px rgba(0,0,0,0.15) is a soft shadow below the box.

How do I make a shadow only on the bottom?

Use a vertical offset and a negative spread, so the shadow shows only below the element.

Why does my shadow look cut off?

The parent element probably has overflow: hidden, which clips anything outside its box, including the shadow. Remove it or give the parent some padding so the shadow has room to show.

Does box-shadow slow down a website?

A few shadows have no noticeable effect. Very large blur values on many elements that move or animate can make scrolling less smooth on slow phones, so keep big shadows for a small number of elements.

Related tools