Skip to content

CSS Box-Shadow Generator

Build a box-shadow with sliders for offset, blur, spread and color — stack as many layers as needed, mark any of them inset for an inner shadow, and copy the finished box-shadow value.

  • Multiple stacked shadow layers
  • Inset (inner) shadows supported
  • Live preview
  • Negative offset and spread supported
  • Copy the CSS in one click

Generator

Generated locally, nothing uploaded

Shadow layers

CSS

How to build a CSS box-shadow

  1. 01

    Set offset, blur and spread

    Offset X and Y move the shadow; blur softens its edge; spread grows or shrinks it before blurring.

  2. 02

    Pick a color, and inset if needed

    Toggle inset to turn an outer shadow into an inner one, cast inward from the element's edge instead of outward.

  3. 03

    Stack more layers if needed

    Add another layer for a more realistic shadow — a tight, dark shadow close to the element plus a soft, faint one further out reads more convincingly than either alone.

  4. 04

    Copy the CSS

    Copy the finished box-shadow value into your stylesheet.

What each value actually controls#

Offset X and Y move the shadow away from the element — positive X moves it right, positive Y moves it down, and both accept negative values to shift left or up. Blur radius controls how soft the shadow's edge is; zero produces a hard-edged silhouette, larger values spread it into a soft gradient. Spread radius grows or shrinks the shadow's shape before the blur is applied — a positive spread makes the shadow larger than the element itself, negative makes it smaller.

Why real shadows are stacked, not single#

A single box-shadow layer reads as flat and slightly artificial, because real-world shadows are not one uniform blur — they are a combination of a tight, high-contrast shadow close to the surface (contact shadow) and a broader, softer, lower-opacity shadow further out (ambient shadow). Material Design's elevation system and most professional UI shadow presets stack two or more layers for exactly this reason. This tool supports adding as many layers as needed, each with independent values.

Inset: casting the shadow inward#

Adding inset to a box-shadow value flips it from casting outward — as if the element were raised above the page — to casting inward, as if it were pressed into a surface or the interior of an inset frame. This is the technique behind a pressed-button effect, a recessed input field, or a vignette effect inside a card. The offset direction still means the same thing; only whether the shadow appears outside or inside the element's border changes.

Frequently asked questions

What does spread radius actually do, versus blur?

Spread grows or shrinks the shadow's shape before blur is applied — a positive spread makes the shadow bigger than the element, negative makes it smaller. Blur then softens whatever shape that produced. They solve different problems: spread for size, blur for softness.

Can I stack more than one shadow on the same element?

Yes — box-shadow accepts a comma-separated list of shadow layers, which is exactly what stacking a tight contact shadow with a broader ambient shadow relies on for a more realistic effect. Add as many layers as needed here.

What does inset actually change?

It flips the shadow from casting outward, as if the element sits above the page, to casting inward, as if it were pressed into the surface. It is the standard technique for a pressed-button or recessed-input look.

Can offset or spread be negative?

Yes, and both are commonly negative in practice — negative offset moves the shadow left or up, and negative spread shrinks the shadow smaller than the element itself.

Is this generated on a server?

No. The CSS is assembled entirely in your browser — nothing you enter is uploaded.

Developers

UUID Generator

Generate cryptographically random UUID v4 or time-ordered UUID v7, in bulk.

Developers

Base64 Encoder & Decoder

Encode and decode Base64 with correct UTF-8 handling, including the URL-safe alphabet.

Developers

ULID Generator

Generate ULIDs — sortable by creation time like UUID v7, but Crockford Base32 instead of hex.