CSS

CSS Box-Shadow Generator

Details

How to use CSS Box-Shadow Generator

What the tool does, how to run it, and what to expect from the result.

How to generate a CSS box-shadow

box-shadow takes four lengths and a colour: a horizontal offset, a vertical offset, a blur radius, and a spread, optionally preceded by the inset keyword. Together they describe where the shadow falls and how soft it is.

The preview applies the declaration to a live element, so you are looking at the real rendering rather than an approximation. Adjust the sliders until it looks right, then copy the declaration.

  • Set the vertical offset first, since that is what suggests the light source, and leave the horizontal offset at zero unless you want a directional light.
  • Increase the blur until the edge is as soft as you want, then pull the spread negative to stop the shadow spilling out at the sides.
  • Choose the shadow colour, then convert it to rgba with an alpha of around 0.1 to 0.25 so the shadow is translucent rather than solid.
  • Toggle inset if you want the shadow drawn inside the element, as on a pressed button or an input well.
  • Copy the declaration, and consider stacking a second, wider and fainter shadow after it, separated by a comma, for a more convincing depth.
Tips

Getting a better result out of CSS Box-Shadow Generator

Specific settings and thresholds, not general advice.

  • A shadow with a fully opaque colour looks fake. Real shadows are translucent, and the single biggest improvement you can make is to convert the hex colour into rgba with an alpha of roughly 0.1 to 0.25, so the shadow tints what is behind it rather than covering it.
  • Convincing depth comes from stacking several shadows, not from making one bigger. The layered look used by most design systems is two or three comma-separated shadows: a tight, darker one for contact and a wide, faint one for ambient light. This tool produces one layer, which you can duplicate by hand.
  • A negative spread is what stops a shadow from spilling out sideways. The default here uses a negative spread deliberately: it pulls the shadow in so the blur reads as a soft drop beneath the element rather than a halo around it.
  • box-shadow paints outside the element and never affects layout, so it cannot push siblings around or trigger a reflow. It does cost paint time, and a very large blur radius across many elements is a measurable scrolling cost on low-end devices.
  • Use inset when you want the shadow inside the element, which is how pressed buttons, input fields, and inset wells are drawn. An inset shadow is drawn over the background but under the content, so text stays legible.
Limits

What CSS Box-Shadow Generator does not do

The honest boundary, so you do not lose time finding it yourself.

  • The colour input produces an opaque hex value, so there is no alpha slider, and you must convert the colour to rgba yourself to get a realistic translucent shadow.
  • It generates one shadow layer only, so the multi-layer stacks used by design systems have to be assembled by hand.
  • It does not generate a text-shadow, a drop-shadow filter, or a React Native shadow, all of which use different syntax.
  • It has no presets, so it will not offer you a standard elevation scale.
At a glance

Who CSS Box-Shadow Generator is for

A quick way to understand who this helps, what it solves, and where it connects next.

Best fit

Frontend developers, designers, and anyone styling web pages.

Ideal for

Quickly building box-shadow CSS visually without writing it by hand.

FAQ

Common questions

Short answers for the questions people usually have before trying a utility like this.

Is the box shadow generator free?

Yes. It is completely free to use, with no signup, no account, and no paywall.

Can I use the generated CSS in commercial projects?

Yes. The CSS you copy from the tool is yours to use in any project, personal or commercial, with no attribution needed.

Does it stay local?

Yes. Everything runs in your browser, and nothing you configure is uploaded to a server.

Why does my shadow look harsh and fake?

Almost certainly because it is fully opaque. The colour picker gives you a solid hex value, and a solid shadow paints a flat block of colour rather than darkening what is behind it. Real shadows are semi-transparent. Take the hex the tool produces, convert it to rgba, and set the alpha somewhere between 0.1 and 0.25. That one change does more for realism than any adjustment to the blur or the offset.

How do design systems get that soft, layered depth?

By stacking shadows. box-shadow accepts a comma-separated list, and the convention is to combine a small, relatively dark shadow with almost no blur, which reads as the object touching the surface, with a much larger and fainter one that reads as ambient light. Two or three layers, each with a different offset, blur, and alpha, produce depth that a single shadow never achieves no matter how you tune it. Generate one layer here and duplicate it.

What does the spread value actually do?

It grows or shrinks the shadow before the blur is applied. A positive spread makes the shadow larger than the element in every direction, which reads as a halo or a glow. A negative spread pulls it in, so that after the blur softens the edges the shadow sits neatly beneath the element rather than leaking out at the sides. Most attractive drop shadows use a negative spread with a generous blur and a downward offset.

Is box-shadow expensive to render?

It does not affect layout, so it never causes a reflow, but it does cost paint time and the cost scales with the blur radius and the painted area. A page with a handful of shadowed cards is fine. A long scrolling list where every row carries a 60-pixel blur will drop frames on a mid-range phone. If you need to animate one, animate the opacity of a pseudo-element carrying the shadow rather than animating box-shadow directly.

Does the preview run locally?

Yes. The preview is a real element with the generated declaration applied, so it renders exactly as it will on your page, and nothing you configure is sent anywhere.

Recommendations

You Might Also Like

Nearby tools from the catalog that fit the same job or workflow.

Cleanor app

Do it all on your device

Cleanor puts these tools in one app: compress and convert images, video, and audio, work with PDFs, and scan text right on your device. Plus free up storage and clear inbox clutter with Email Cleaner. Start with a free trial.

  • iPhone
  • Android
  • Macsoon
  • Windowssoon