Generate CSS box-shadow code with interactive sliders. Adjust offset, blur, spread, color, and opacity visually with a live preview — copy CSS instantly.
Box Shadow Generator is a free, browser-based tool
from UseToolSuite's
Color & CSS Tools collection.
All processing happens locally on your device — your data is never uploaded to any server.
Use the tool below, then scroll down for detailed documentation, frequently asked questions, and related resources.
What is Box Shadow Generator?
Box Shadow Generator is a free online tool that lets you
visually design CSS box-shadow effects using intuitive sliders
and controls. You can adjust horizontal and vertical offsets,
blur radius, spread radius, shadow color, and opacity in real
time while seeing the result on a live preview box. It also
supports inset shadows for inner glow effects. The tool outputs
the complete CSS box-shadow property ready to copy and paste
into your stylesheet, saving time compared to manual trial and
error in your code editor.
When to use it?
Use the Box Shadow Generator when you need to create depth,
elevation, or emphasis on UI elements like cards, modals,
buttons, or dropdown menus. It is particularly helpful when
experimenting with different shadow intensities and colors to
match your design system. Instead of guessing pixel values and
opacity levels, you can visually dial in the exact shadow you
want and then grab the CSS code.
Common use cases
Developers and designers commonly use Box Shadow Generator to
add subtle elevation to card components, create floating button
effects with soft shadows, design inset shadows for pressed or
recessed input fields, build layered shadow effects for modern
glassmorphism designs, and prototype Material Design elevation
levels. It is also used to generate consistent shadow tokens for
design systems where every elevation level needs precise
pixel-perfect values.
Elevation system: designing with shadow depth levels
Modern design systems use shadow elevation levels to create visual hierarchy. Level 0 has no shadow (flat elements). Level 1 uses a subtle 0 1px 3px rgba(0,0,0,0.12) for cards. Level 2 adds more depth for dropdowns with 0 4px 6px rgba(0,0,0,0.1). Level 3 creates floating elements like modals with 0 10px 25px rgba(0,0,0,0.15). Material Design uses 6 elevation levels. Tailwind CSS provides shadow-sm through shadow-2xl. The key principle is consistency — once you define your elevation scale, every component should use the same shadow values.
The four numbers (plus a keyword)
A box-shadow is offset-x offset-y blur spread color, with an optional inset:
| Value | Controls | Effect |
|---|
| offset-x / y | Direction | Where the shadow falls |
| blur | Softness | 0 = hard edge, higher = diffuse |
| spread | Size | Grows (+) or shrinks (−) the shadow |
| color | Tint | Usually low-opacity black |
inset | Inside vs outside | Recessed/inner shadow |
The most underused of these is spread: a positive spread with zero blur and zero offset creates a solid outline that doesn’t affect layout, and a negative spread tightens a shadow so only part of it shows — handy for subtle bottom-only elevation.
Color the shadow, don’t just darken it
Flat-looking shadows are often pure black. Real shadows pick up the surface and ambient color, so a subtly tinted shadow (a dark version of the element’s hue, or a navy-tinted shadow on a blue UI) reads richer than rgba(0,0,0,0.5). Keep opacity low — 10–25% is the sweet spot for believable elevation; heavier shadows look heavy. The element can even cast a shadow in its own color for a glow effect by matching the shadow color to the element.
- Overflow clipping — box-shadow is drawn outside the box, so a parent with
overflow: hidden (common on cards, carousels, modals) clips it. Either pad the container or move the shadow to a wrapper — or switch to drop-shadow(), which overflow doesn’t clip.
- Animation jank — animating
box-shadow directly forces a repaint every frame and stutters with large blur. Instead, put the “hover” shadow on a pseudo-element and animate its opacity (GPU-composited), or add will-change as a hint. The shadow appears to grow smoothly without the repaint cost.
Use the live preview here to tune offset, blur, and opacity, then layer a few of the generated shadows together for the realistic look described above.
How helpful was this tool?
Click to rate
Awesome! Glad it helped.
We don't have a marketing budget. The best way to support this free tool is by sharing it with other developers!
Help us improve!
Sorry it didn't meet your expectations. We're always looking to make these tools better. What was missing or broken?
Open GitHub Issue