Box Shadow Generator

Build up to eight box-shadow layers with offsets, blur, spread, opacity and inset, then copy their CSS.

Inputs stay on your device No sign-up Free to use
How this works

The tool runs in this browser. Your file or text is not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.

Privacy details

Generate CSS controls

Optional. One layer per line as offsetX offsetY blur spread #hex opacity, with inset as an optional last word, for example 0 2px 4px 0 #000000 20% inset. Up to eight layers in total, counting the first one above.

Processed in your browser. Your inputs stay on this device.

Showing a generated example. Generate again for a new result.

How to use Box Shadow Generator

  1. Set the horizontal and vertical offsets, then the blur and spread radii.
  2. Pick the shadow color and its opacity, and turn on inset if the shadow should sit inside the box.
  3. For more layers, enter offsetX offsetY blur spread #hex opacity, one per line. Add inset as the last word when needed.
  4. Check the live preview, then copy the CSS rule into your stylesheet.

Example: Box Shadow Generator

Build a soft shadow below a card.

You add
Horizontal offset: 0. Vertical offset: 10. Blur radius: 30. Spread radius: 0. Shadow color: #20372d. Opacity: 30%. Inset: off.
You get
The rule is .card { box-shadow: 0 10px 30px 0 rgba(32, 55, 45, 0.3); } and the preview shows the same shadow under the box.

Options

Offsets and radii
The horizontal offset moves the shadow right or left and the vertical offset moves it down or up. Blur softens the edge, and spread grows or shrinks the shadow before the blur is applied.
Color and opacity
The color picker sets the shadow hue and the opacity sets how much background shows through, written as an rgba value in the CSS.
Inset
An inset shadow paints inside the box instead of behind it, which suits pressed buttons and input fields.

Supported inputs and limits

Up to eight layers, counting the first one in the controls. Extra layer text is limited to 8,192 characters. Each layer accepts offsets from -100px to 100px, blur from 0 to 200px, spread from -50px to 50px and opacity from 0% to 100%. The preview and copied rule include every layer in order. The preview surface may differ from your own background. This page does not assess the shadow contrast on your site.

Where your input is processed

This tool processes your input in this browser. Your text and files are not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.

Why the preview box has a surface color

A shadow is a darker copy of the element's shape drawn behind it, so it only reads against a background that differs from the shadow color. The preview paints the box with the page's own surface color and keeps padding around it, so a shadow that looks weak in the preview will also look weak on a plain page. Check the rule on the real element before you keep it.

Questions about Box Shadow Generator

Why is my shadow invisible?

A large blur with a low opacity fades away quickly, and a shadow with the same tone as the background disappears. Raise the opacity or pick a color with more contrast against the surface.

What does spread do?

Positive spread grows the shadow before the blur is applied, and negative spread shrinks it. A negative spread equal to the blur is one common way to make a crisp edge.

Can I put the shadow inside the box?

Yes. Turn on inset and the shadow paints inside the element, which is how pressed buttons and inset fields are usually drawn.

Can I copy several shadows at once?

Yes. Extra shadow layers accepts one layer per line, for example 0 2px 4px 0 #000000 20% inset. The first layer uses the controls above it. The result combines all layers into one comma-separated box-shadow rule, with up to eight layers total.

Project manager: Tony Hines · Content updated 30 September 2026 · Report a problem