CSS Box Shadow Generator

Adjust each shadow layer with the sliders and color fields, and watch the preview update. Choose inset for a shadow inside the box, and copy the finished box-shadow declaration. Three presets get you started.

CSS Box Shadow Generator runs entirely in your browser: the text you paste is never sent to a server. It is free and needs no sign-up.

How to use it

  1. Pick a preset or edit layers Start from one of the four presets, or change the layers directly. Each layer has x and y offsets, blur, spread, a HEX color, an opacity value and an inset option. You can add up to 6 layers.
  2. Check the preview The preview box updates as you change the layers. Switch the preview background between checkered, light and dark to see the shadow on each one. The box color and corner radius only change the preview.
  3. Copy the box-shadow line Press Copy to copy the box-shadow declaration, which reads none when no layer is left. Paste it into the rule of the element that should cast the shadow in your stylesheet.

Questions

What do the x, y, blur and spread values mean?

X moves the shadow sideways and Y moves it down, both in pixels. Blur softens the edge, so a larger value spreads the shadow further. Spread grows the shadow when positive and shrinks it when negative. X, Y and spread run from -200 to 200, and blur runs from 0 to 300.

Why are some colors written as rgba()?

A color with opacity below 100% is written as rgba() with the alpha value rounded to 2 decimal places, such as rgba(0, 0, 0, 0.25). A fully opaque color stays a 6-digit HEX code. Each layer goes on its own line, which keeps long shadows easy to read.