CSS Box Shadow Generator
Build CSS box shadows with sliders for offset, blur, spread, color and opacity. Stack up to 6 layers, preview live, copy as CSS or Tailwind.
A shadow needs at least 1 layer, so this one cannot be removed.
box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.08);
shadow-[0px_4px_16px_0px_rgba(0,0,0,0.08)]
01 · Definition
What is box-shadow in CSS?
box-shadow is the CSS property that draws one or more shadows around an element's box. Each shadow has a horizontal offset, a vertical offset, a blur radius, a spread radius and a color, plus an optional inset keyword that draws it inside the box. Several shadows are separated by commas and painted front to back.
02 · Overview
How the CSS Box Shadow Generator works
Compose box shadows visually. Stack up to 6 layers and set offset, blur, spread, color, opacity and inset for each one while the preview updates. Six presets (Subtle, Card, Hover, Pop, Inset, Focus ring) give a starting point. Copy the result as a CSS box-shadow declaration or as a Tailwind arbitrary-value class. Everything runs in your browser.
03 · Guide
box-shadow syntax: what each value means
A shadow is written as up to four lengths and a color, in a fixed order: offset-x, offset-y, blur-radius, spread-radius, color. The tool always writes all four lengths, as in box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.08). The inset keyword in front turns it into an inner shadow, and commas separate layers.
The meanings in the table follow MDN's box-shadow reference; the ranges are those of this tool's sliders.
| Value | Effect | Range in this tool |
|---|---|---|
| offset-x | Moves the shadow right; negative values move it left | -40px to 40px |
| offset-y | Moves the shadow down; negative values move it up | -40px to 40px |
| blur-radius | Bigger and lighter as it grows; 0 is a sharp edge; never negative | 0 to 80px |
| spread-radius | Positive values grow the shadow, negative values shrink it | -40px to 40px |
| color | Written as rgba() from the hex color and the opacity | 0 to 100% opacity |
| inset | Draws the shadow inside the box | On or off per layer |
04 · Use cases
When to use the CSS Box Shadow Generator
- 01
Find the right elevation for a card by adjusting sliders against a live preview
- 02
Build a two-layer shadow: a tight contact shadow plus a soft ambient one
- 03
Rebuild a shadow from a design file by entering its offsets, blur and color
- 04
Get the Tailwind arbitrary-value form of a custom shadow
05 · Examples
CSS Box Shadow Generator examples
One layer: Y 4px, blur 16px, black at 8% opacity (the default)
ex 01box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.08);
A subtle card-elevation shadow.
Card preset: two layers
ex 02box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05), 0px 4px 12px 0px rgba(0, 0, 0, 0.08);
A tight near-surface shadow stacked with a softer ambient layer.
Focus ring preset: spread 3px, #3b82f6 at 45% opacity
ex 03box-shadow: 0px 0px 0px 3px rgba(59, 130, 246, 0.45);
Zero offset and zero blur turn box-shadow into a ring that takes no layout space.
Inset preset
ex 04box-shadow: inset 0px 2px 4px 0px rgba(0, 0, 0, 0.10);
An inset shadow along the top edge reads as the surface being pushed in.
Tailwind output for the default shadow
ex 05shadow-[0px_4px_16px_0px_rgba(0,0,0,0.08)]
An arbitrary value; underscores stand for spaces.
06 · FAQ
Box Shadow: frequently asked questions
What is shadow spread?
What ranges do the sliders cover?
Should I use inset shadows?
How do I avoid a flat, generic-looking shadow?
How do I make a shadow that still reads in dark mode?
What's the difference between box-shadow and drop-shadow?
Do box shadows hurt performance?
07 · Reference
Specs and further reading
These are the primary sources this tool follows. Where a specification defines the behaviour, we link the specification, not a summary of it.
- box-shadow
MDN Web Docs. Reference for offset, blur, spread, inset, and multi-shadow syntax.
- CSS Backgrounds and Borders Module Level 3
W3C. The specification that defines how box shadows are painted and layered.
08 · More
Tools that pair with Box Shadow
Glassmorphism Generator
Build a frosted-glass card with sliders for blur, opacity, saturation, border and radius. Preview it over five backdrops and copy the CSS or Tailwind.
CSS Animation Generator
Pick one of 12 CSS keyframe animations, set duration, delay, easing, iterations and direction, preview it, and copy the @keyframes CSS or a Tailwind class.
Color Picker & Converter
Convert a color between HEX, RGB, HSL, OKLCH and CMYK. Paste any of those formats or a CSS color name, and see WCAG contrast against white and black.
CSS Gradient Generator
Build linear, radial and conic CSS gradients with 2 to 8 color stops. Drag the stops or type exact values, then copy the CSS or a Tailwind class.