CSS Box Shadow Generator
Layered Shadows, Live Preview
Design a shadow and copy the CSS. Stack multiple layered shadows, set offset, blur, spread, color with opacity and inset, then copy the box-shadow declaration or a Tailwind class. 100% client-side. Zero data stored.
CSS Box Shadow Generator Tool
Design a Box Shadow
Presets
CSS
Tailwind CSS
Tailwind has no utility for a custom shadow, so this is an arbitrary value that works in versions 3 and 4. Its built-in shadow-md and shadow-lg are different values.
Whole element
Common Use Cases
Cards and Panels
Lift a card, dialog or dropdown off the page with a soft shadow, and copy the exact value for your stylesheet.
Smooth Layered Shadows
Stack several faint shadows of growing size for a natural falloff that a single blur cannot give.
Neumorphism
Pair a dark and a light shadow on a same-color box for the soft, extruded look, and check it on your real background.
Glows and Focus Rings
Use a zero-offset colored shadow for a neon glow, or a spread-only shadow for a focus ring that follows the corners.
Hard Offset Shadows
Set the blur to zero for the flat, comic and brutalist offset look on buttons and cards.
Inner Shadows
Turn on inset to press a field or panel into the page, and combine it with an outer shadow on the same element.
Box Shadow Syntax Reference
The Parts of One Shadow
| Part | Example | What it does |
|---|---|---|
| X offset | 6px | Moves the shadow right; negative moves it left |
| Y offset | 10px | Moves the shadow down; negative moves it up |
| Blur | 25px | Softens the edge; 0 is a hard edge and it cannot be negative |
| Spread | -4px | Grows or shrinks the shadow before the blur; needs a blur value written before it |
| Color | rgba(0, 0, 0, 0.25) | Any CSS color; opacity usually makes a shadow look natural |
| inset | inset 0 2px 4px #000 | Draws the shadow inside the box instead of outside |
Output Shortening and Layers
| You set | The CSS is written as |
|---|---|
| Blur 0, spread 0 | 6px 6px #000 |
| Blur 25, spread 0 | 0 10px 25px rgba(0, 0, 0, 0.25) |
| Blur 0, spread 3 | 0 0 0 3px #3b82f6 |
| Two or more shadows | one per line, separated by commas |
With several shadows, the first one is drawn on top. Use the arrows on each shadow to change the order.
Follows the box
A box shadow follows the rectangle and its border radius. It does not follow the outline of a transparent PNG or an SVG; use filter: drop-shadow() for that.
Clipped by clip-path
A clip-path on the same element cuts its shadow off too. Put the shadow on a wrapper element instead.
Cost of large blurs
Big blur values on large elements that animate can slow painting on weak devices. Animate opacity or transform instead when you can.
Related tools
Round the corners with the Border Radius Generator and pick colors with the Color Converter.
Pro Tip: URL Parameters
Open the generator with a design already loaded. Use ?preset= with soft, hard, smooth, neumorphism, glow or inner, or describe the whole design with ?s=, ?box=, ?bg= and ?r=. For example: /box-shadow-generator/?preset=glow or /box-shadow-generator/?s=0,10,25,0,000000,0.25,0&box=ffffff&bg=f1f5f9&r=16
Each shadow in s is x,y,blur,spread,hex,opacity,inset (1 for inset, 0 for outer), with several shadows joined by a tilde. Colors are HEX without the #. The Copy Link button builds the link from your current design.
Frequently Asked Questions
Click Add shadow. Each shadow is one layer, and the CSS joins them with commas in a single box-shadow declaration. The first layer is drawn on top, so use the arrows on each shadow to change the order. You can have up to ten layers.
X offset moves the shadow right (negative is left) and Y offset moves it down (negative is up). Blur softens the edge, and 0 gives a hard edge. Spread grows or shrinks the shadow before the blur is applied, so a spread of 3px with no blur draws a solid ring. Blur cannot be negative; spread can.
Tick Inset on a shadow. The CSS then starts with the inset keyword and the shadow is drawn inside the box. You can mix inset and outer shadows on the same element, which is how pressed buttons and recessed fields are usually built.
One big blurred shadow often looks flat or muddy. Stack several faint shadows whose offset and blur double each time, for example 0 1px 1px, 0 2px 2px, 0 4px 4px, 0 8px 8px and 0 16px 16px, each at about 8 percent black. The Layered smooth preset loads exactly that.
Neumorphism uses two shadows on a box that is the same color as its background: a darker one offset down and right, and a lighter one offset up and left. A glow is a shadow with no offset, a large blur and a bright color. Both are presets, and you can tune them on your own colors.
box-shadow draws a shadow for the rectangular box and its border radius, not for the visible pixels inside it. For a transparent PNG or an SVG, use filter: drop-shadow() instead. This tool generates box-shadow only and does not generate drop-shadow.
A parent with overflow set to hidden clips any shadow that reaches outside it, and a clip-path on the same element clips its own shadow. Add padding to the parent, remove the overflow, or put the shadow on a wrapper element that is not clipped.
Yes. The Tailwind block gives an arbitrary-value class such as shadow-[0_10px_25px_rgba(0,0,0,0.25)], where spaces become underscores. It works in Tailwind 3 and 4. It will not match the built-in shadow-md or shadow-lg classes, whose values differ between Tailwind versions.
Yes. Use ?preset= with soft, hard, smooth, neumorphism, glow or inner, or describe the whole design with ?s=, ?box=, ?bg= and ?r=. For example /box-shadow-generator/?s=0,10,25,0,000000,0.25,0&box=ffffff&bg=f1f5f9&r=16. The Copy Link button builds the link from your current design.
No. The preview and the CSS are made in your browser with JavaScript. Nothing you create is uploaded, logged or stored, and the tool keeps working offline once the page has loaded.
Why We Built This Box Shadow Generator
A good shadow is rarely one value. Designers stack several faint layers, add a colored glow or an inner edge, and then tweak the numbers until it looks right. Typing that into a stylesheet by trial and error is slow, and most generators only handle a single shadow. We built one page where every layer has its own offset, blur, spread, color, opacity and inset switch, and the preview updates as you drag.
The output is written in its shortest valid form, so a hard shadow is just 6px 6px #000 and a focus ring has no stray zeros. You can copy the declaration, a Tailwind class, or the whole element rule, download it as a CSS file, and share a link that restores the exact design. Everything runs in your browser - nothing you design is sent anywhere.
The Box Shadow Generator is part of RJL.io's collection of free developer tools. Round the corners with the Border Radius Generator, cut shapes with the Clip Path Generator, and build backgrounds with our Gradient Generator.