Box Shadow Generator

Create CSS box shadows with visual controls and code output. Free, fast, and works entirely in your browser with no sign-up required.

Updated

Share:
Home/Utility Tools/Box Shadow Generator

Box Shadow Generator

Create beautiful multi-layer CSS box shadows with live preview, presets, and multiple output formats.

Live Preview

Drag the element to adjust active layer's X/Y offset

Shadow Layers
1

Preset Library

Material

Neumorphic

Glow

Card

Button

Generated Code

.element {
  box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.10);
}

About Box Shadow Generator

  • Multiple shadow layers with individual enable/disable
  • Drag the preview element to set X/Y offset interactively
  • Layer reordering, duplication, and removal
  • Neumorphism generator with auto color calculation
  • 15+ curated presets across 5 style groups
  • Preview element: card, button, avatar, image
  • Output: CSS, Tailwind, SCSS, styled-components, Design Tokens
  • History with up to 20 saved states

Privacy First: All processing happens locally in your browser. No data is sent to any server.

Frequently Asked Questions

What do the five box-shadow values mean?

A CSS box-shadow is built from five parts, and each slider in this tool maps to one of them. The X offset moves the shadow left or right, and the Y offset moves it up or down, so a positive Y drops the shadow below the element like overhead light. Blur radius controls how soft the edge is: zero gives a hard, crisp line, while a larger value spreads it into a diffuse haze. Spread grows or shrinks the shadow before the blur is applied. Color, with its opacity, is output as an rgba() value so the transparency is baked in. A sixth keyword, inset, flips the whole shadow inward for a pressed look. Adjust each slider above and the live preview updates instantly, so you can see exactly how a value changes the result before copying the code.

How do I stack multiple box shadows on one element?

In CSS you put several shadows in one box-shadow rule by separating each with a comma, and they render back to front, so the first shadow sits on top. This tool handles that for you: you add a new layer, and it manages the comma-separated syntax automatically. Layering is how realistic depth is built, because a single shadow looks flat while two or three at different offsets, blurs, and opacities mimic how light actually falls. You can reorder layers, duplicate one as a starting point, and toggle any layer on or off to compare looks without deleting it. The Material elevation presets use exactly this approach, stacking two or three layers per level the way Google's spec does. Build your stack with the layer controls above, then copy the combined rule in one click.

What is negative spread and why does it make card shadows look better?

Spread expands or contracts a shadow before blur is applied. A positive spread makes the shadow larger than the element, while a negative spread shrinks it inward so the shadow sits tighter underneath. Negative spread is the trick behind modern card shadows: by pulling the shadow in and pushing it down with a small Y offset, you get a soft pool of shadow directly below the card instead of a fuzzy halo leaking out on every side. That reads as a subtle, grounded elevation rather than a dated drop shadow. Pairing a low opacity color with negative spread and a moderate blur is the recipe most design systems use for clean, lifted cards. The spread slider here runs from -50px to 50px, so set a negative value, watch the preview tighten, and copy the result straight into your stylesheet.

What is neumorphism and how does the soft-UI mode create it?

Neumorphism, or soft UI, is a style where elements look extruded from the background rather than floating above it, as if pressed out of the same material. The effect needs two shadows on a single surface color: a dark shadow on one side and a light highlight on the opposite side, so the element appears gently raised. Getting that pair right by hand is fiddly because both shadows must derive from the same base color. This tool's dedicated Neumorphism mode does the math for you: set a base color, intensity, distance, and blur, and it calculates the matching light and dark shadow pair automatically. You can preview it on a card, button, or avatar and switch between light and dark backgrounds to check contrast. Open the soft-UI mode above, tune the base color, and copy the generated shadow pair.

Can I export the shadow as Tailwind, SCSS, or design tokens?

Yes. The generator produces the same shadow in five copy-ready formats so it drops straight into your stack. You get plain CSS as a ready-to-paste box-shadow rule, a Tailwind arbitrary-value class in the shadow-[...] form, an SCSS variable you can reuse across partials, a styled-components template literal for CSS-in-JS, and design tokens as JSON in the standard token shape for design-system pipelines. You can copy the full rule, copy just the raw value when you only need the part after the property, or download the output as a file. A built-in history keeps up to 20 of your recent states, so you can step back to an earlier version without redoing your work. Build the shadow you want above, pick the format that matches your project, and grab the code in one click.

Embed This Tool

Add a free, live version of this widget to your own website or blog post — it runs entirely in your visitors' browsers, with a credit link back to The Toolbox.

Copy & paste this HTML
<iframe src="https://getthetoolbox.com/embed/box-shadow-generator" title="Box Shadow Generator — The Toolbox" width="100%" height="360" style="max-width:480px;border:1px solid #e2e8f0;border-radius:12px" loading="lazy"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://getthetoolbox.com/utility-tools/box-shadow-generator?utm_source=embed&utm_medium=widget" target="_blank" rel="noopener">Free Box Shadow Generator</a> by The Toolbox</p>

About the Box Shadow Generator

The Box Shadow Generator is a free visual tool for building CSS box-shadow values without writing them by hand. You adjust offset, blur, spread, color, and opacity with sliders and watch a live preview update in real time, then copy the generated code straight into your stylesheet. It is built for front-end developers, UI designers, and anyone tweaking a component who would rather see a shadow than guess at numbers.

Unlike a single-shadow picker, this generator works in layers. You can stack multiple shadows on one element, reorder them, duplicate a layer, and toggle individual layers on or off — the same technique professional design systems use to create depth that feels physical rather than flat.

What a box shadow is and how the controls map to CSS

A CSS box shadow is defined by five values, and every slider here corresponds to one of them:

  • X and Y offset — how far the shadow is pushed horizontally and vertically, from -50px to 50px. Positive Y drops the shadow below the element; negative Y lifts it above.
  • Blur radius — how soft the edge is, from 0 (a hard, crisp shadow) up to 100px. Larger blur reads as a higher, more diffuse light source.
  • Spread — grows or shrinks the shadow before blur is applied, from -50px to 50px. Negative spread is the trick behind tight, modern card shadows.
  • Color and opacity — pick any hex color and set opacity from 0 to 100%. The tool outputs the result as an rgba() value so the transparency is baked in.
  • Inset — a checkbox that flips the shadow inward, producing a pressed or recessed look instead of a raised one.

You can drag the preview element directly to set the active layer's X and Y offset, or type exact numbers into the input fields when you need precision.

Presets, neumorphism, and live preview

Fifteen curated presets are grouped into five styles — Material elevation, Neumorphic, Glow, Card, and Button — so you can start from a proven look and adjust from there. The Material presets mirror elevation levels (each stacks two or three layers, exactly as Google's spec does), while the Glow presets use zero offset with colored blur to ring an element in light.

A dedicated Neumorphism mode generates the soft-UI "raised from the surface" effect automatically: you set a base color, intensity, distance, and blur, and the tool calculates the matching light and dark shadow pair for you. Preview your shadow on a card, button, avatar, or image, switch between light and dark backgrounds, and adjust the element's border radius up to 100px to see how the shadow behaves on rounded shapes.

Copy-ready output in five formats

When the shadow looks right, export it however your project needs it. The generator produces:

  • CSS — a ready-to-paste box-shadow rule.
  • Tailwind — an arbitrary-value shadow-[...] class.
  • SCSS — a reusable $box-shadow variable.
  • styled-components — a styled template literal.
  • Design tokens — JSON in the standard token shape for design-system pipelines.

Copy the full rule, copy the raw value only, or download the result as a file. A built-in history keeps up to 20 of your recent states so you can step back to an earlier version without losing your work.

Everything runs entirely in your browser. There is no sign-up, no upload, and no server processing — your colors, values, and generated code never leave your device, so the tool works the same whether you are online or off. Adjust the sliders above, grab the code, and drop a polished shadow into your design in seconds.