CSS Box Shadow Generator

Generate CSS box-shadow code interactively. Adjust offset, blur, spread, color and opacity with live preview. Stack multiple shadows, toggle inset, add vendor prefixes, and copy ready-to-use CSS instantly. Includes 8 popular presets. Free, 100% client-side.

0 chars

Did we solve your problem today?

What is a CSS Box Shadow Generator?

A CSS box shadow generator lets you build box-shadow values visually and copy the ready-to-use CSS code in seconds. Instead of guessing pixel values and refreshing your browser, you adjust sliders for offset, blur, spread, color, and opacity — and see the result live. This css shadow generator online eliminates trial-and-error and speeds up UI development for buttons, cards, modals, and any other element that needs depth or elevation.

How to Use This Tool

  1. Adjust the sliders — set Offset X, Offset Y, Blur, and Spread to shape the shadow direction and softness
  2. Pick a color and opacity — use the color picker or type a hex code; opacity controls the alpha channel independently of the color
  3. Toggle Inset to flip the shadow inside the element (great for pressed button states or inner glows)
  4. Stack shadows — click + Add Shadow to add up to five layers; select each pill to edit it independently
  5. Load a preset — click any preset button to instantly apply a professionally designed shadow combination
  6. Copy the CSS — enable -webkit- vendor prefixes if needed, then click Copy

Understanding box-shadow Parameters

ParameterRangeEffect
Offset Xnegative to positiveMoves the shadow left (negative) or right (positive)
Offset Ynegative to positiveMoves the shadow up (negative) or down (positive)
Blur0 and above0 = hard edge; higher values = softer, more diffuse shadow
Spreadnegative to positiveExpands (positive) or shrinks (negative) the shadow before blurring
Inseton/offPlaces the shadow inside the element border rather than outside

Stacking Multiple Shadows

CSS allows multiple comma-separated shadows on a single element. This technique is used in popular design systems like Material Design (two-layer shadows for elevation) and Neumorphism (light + dark shadows for an embossed effect). The generated box shadow css code combines all layers into one box-shadow property, ready to paste.

Vendor Prefixes

Modern browsers support box-shadow without prefixes. Enable -webkit-box-shadow only if you must target very old Safari or Chrome versions (pre-2011). The toggle adds the prefixed line above the standard property.

Privacy

All calculations happen locally in your browser. No shadow values or CSS code is ever sent to a server.

FAQ

What is a CSS box shadow?

A CSS box shadow adds a shadow effect around an element's frame. It is defined by horizontal offset, vertical offset, blur radius, spread radius, and color. You can also make it "inset" so the shadow appears inside the element. Multiple shadows can be stacked by separating them with commas.

How do I stack multiple shadows?

Click the "+ Add Shadow" button to add a second (or third) shadow layer. Each layer is configured independently. All layers are combined into a single box-shadow value separated by commas, which browsers render in order from top to bottom.

What does the Spread value do?

Spread expands or shrinks the shadow before blurring. A positive value makes the shadow larger than the element; a negative value shrinks it. Combined with zero blur, a negative spread creates a tight shadow that only appears in one direction.

Do I need vendor prefixes for box-shadow?

No. All modern browsers (Chrome, Firefox, Safari, Edge) support box-shadow without prefixes. Enable vendor prefixes (-webkit-) only if you need to support very old browsers such as iOS Safari below version 5 or Chrome below version 10.