HomeTools › CSS Box Shadow Generator

CSS Box Shadow Generator

Design multi-layer box shadows visually — stack up to 5 shadows, pick elevation or neumorphism presets, and copy production-ready CSS, Tailwind, or design-token output.

Preview

Press Ctrl+D (or Cmd+D on Mac) to bookmark this page.

How it works

Add shadow layers

Start with one shadow, or click Add layer to stack up to 5 for a more realistic, elevated effect.

Adjust offset, blur & spread

Drag the sliders on each layer to set horizontal/vertical offset, blur radius, and spread.

Pick color, opacity & inset

Choose a shadow color and opacity per layer, and toggle inset for a pressed-in look.

Copy the CSS

Copy the ready-to-paste CSS, or switch tabs for a Tailwind arbitrary value or a CSS custom property token.

Using this box shadow in code

Copy your generated shadow into any of these formats:



About the CSS Box Shadow Generator

This CSS box shadow generator builds single or multi-layer box shadows visually — adjust offset, blur, spread, color and opacity per layer, preview on a card, button or circle, and copy production-ready CSS instantly. No sign-up, no uploads, everything runs in your browser.

A well-placed shadow is one of the simplest ways to add depth to a flat interface. It tells the eye which elements sit above the page and which sit below it, without a single extra pixel of image weight — because box-shadow is pure CSS, it scales sharply at any resolution and can be edited instantly.

The five box-shadow values — what each one does

The box-shadow property accepts, in order: horizontal offset (positive moves the shadow right), vertical offset (positive moves it down), blur radius (higher values fade the edge more softly), spread radius (expands or shrinks the shadow before blur is applied), and color. An optional inset keyword flips the shadow inside the element instead of outside it.

Single vs. layered shadows — why stacking looks more realistic

A single flat shadow works fine for subtle depth, but real light rarely produces just one shadow edge. Design systems like Material Design stack a tight, darker shadow close to the element with a larger, softer, lighter shadow further out — this tool lets you stack up to 5 layers and copies the full comma-separated declaration in one click.

Use caseTypical setupBest for
Flat card1 layer, low blur, low opacityTable rows, list items, subtle borders
Elevated card2 layers, medium blur/spreadCards, dropdowns, popovers
Modal / dialog2 layers, large offset & blurModals, dialogs, floating panels
Inset / pressed1 layer with insetInput fields, pressed buttons, toggles
Neumorphism2 opposing layers, matching backgroundSoft UI dashboards, skeuomorphic controls

Matching shadow style to UI elevation

💡 Key takeaways

  • Free CSS box shadow generator — instant results in your browser
  • Stack up to 5 shadow layers with independent offset, blur, spread, color, and opacity
  • Built-in elevation, glow, neumorphism, and inset presets
  • Export to CSS, a CSS custom property token, or Tailwind arbitrary value
💡

Pro tip: Use rgba() with 10-20% opacity instead of solid black for shadow color — it blends naturally with whatever background sits behind the element instead of looking like a flat gray blob.

Neumorphism and inner shadows

Neumorphism (soft UI) creates the illusion that an element is molded from the same material as its background, by placing a dark shadow on one side and a light highlight on the opposite side of a flat-colored surface. Inset shadows work the same way in reverse — flipping the shadow inside the element's border to suggest a pressed-in or recessed state, commonly used for form inputs, toggle switches, and active button states.

Performance notes

Box shadows are GPU-composited in modern browsers and generally perform well, even when animated on hover or focus. For very large elements or many shadowed items animating at once, transitioning the opacity of a pseudo-element carrying the shadow is a lighter-weight alternative to animating box-shadow directly, since it avoids repeated paint operations on every frame.

Why choose our tool?

100% Private

Everything runs in your browser. Your data never leaves your device — no uploads, no server processing, no tracking.

Instant Results

No loading screens, no waiting, no queues. Results appear the moment you click — powered by client-side JavaScript.

No Sign-Up Ever

No accounts, no emails, no passwords. Just open the page and start using it — forever free, no strings attached.

Works Everywhere

Phone, tablet, laptop, desktop — any browser, any OS. Fully responsive and works offline once loaded.

Also useful if you searched for: css box shadow generator, box shadow generator, css shadow generator, box-shadow css code, multiple box shadow css, material design shadow generator, neumorphism shadow generator, css inset shadow, drop shadow css generator, css elevation shadow.

Frequently asked questions

What are the five values in a box-shadow?
In order: horizontal offset, vertical offset, blur radius, spread radius, and color. Only the offsets and color are required — blur and spread default to 0 if omitted, and an optional inset keyword flips the shadow inside the element.
How do I create a layered, realistic-looking shadow?
Stack two shadows: a small, tight, darker one close to the element for definition, and a larger, softer, lighter one further out for ambient depth. This tool lets you add up to 5 layers and copies the full comma-separated CSS automatically.
What's the difference between blur and spread?
Blur softens the edge of the shadow — higher values fade out more gradually. Spread expands or shrinks the shadow's size uniformly in every direction before blur is applied, independent of the element's own size.
How does inset change the shadow?
A normal shadow sits outside the element's border, implying it's raised above the page. Adding inset flips it inside the element's edges, creating a pressed-in or recessed look often used for input fields and toggle switches.
What is neumorphism and how is the shadow built?
Neumorphism (soft UI) uses two opposing shadows on the same flat-colored background — a dark shadow on one side and a light highlight on the other — to make an element look like it's molded from the same material as its background.
Can I export this shadow as a CSS variable or design token?
Yes — the code section below the generator includes a ready-to-copy CSS custom property format ( --shadow-md: ... ), a plain box-shadow declaration, and a Tailwind arbitrary-value class.
Do box shadows affect layout or element size?
No — box-shadow is purely visual and never affects the document flow, the element's box model, or the position of surrounding elements, unlike a border or outline.
Is box-shadow expensive for performance?
Box shadows are GPU-composited in modern browsers and generally perform well, even animated. For very large elements or many shadowed items at once, transitioning opacity on a pseudo-element carries a lighter paint cost than animating box-shadow directly.
How many shadow layers should I actually use?
One or two layers cover almost every real design — a single flat shadow for subtle depth, or two stacked shadows for a more polished, physically believable elevation. Three or more is mostly useful for glow effects or stylized neumorphic looks.
Is my shadow data saved anywhere?
No — everything is generated live in your browser with JavaScript. Nothing is uploaded, saved, or sent to any server.

Related tools