Skip to content

CSS box-shadow generator

Create realistic CSS drop shadows (box-shadow) and copy the code.

Preview
CSS code
-webkit-box-shadow: {{ cssShadowValue }}; box-shadow: {{ cssShadowValue }};

Properties

Horizontal offset (X) {{ offsetX }}px
Vertical offset (Y) {{ offsetY }}px
Blur {{ blurRadius }}px
Spread {{ spreadRadius }}px
Shadow opacity (alpha) {{ shadowOpacity }}
Inner shadow (inset)

Preview colors

Shadow
Box
Background

Syntax of the CSS box-shadow property

The box-shadow property adds one or more drop shadows to the frame of an HTML element. It follows a very specific order:

  • X offset (offset-x): The horizontal axis. A positive value pushes the shadow to the right, a negative value to the left.
  • Y offset (offset-y): The vertical axis. A positive value pushes the shadow down, a negative value up.
  • Blur radius (blur-radius): The higher the value, the more diffuse, wide and light the shadow. At 0, the shadow is sharp (solid).
  • Spread (spread-radius): A positive value enlarges the shadow on all sides, a negative value shrinks it.
  • Color: Usually defined in RGBA to handle the shadow's transparency over its background.
  • Inset : Optional keyword to place the shadow inside the element (inset effect).

UI design tip: how do you make a nice shadow?

The classic beginner mistake is to use a fully opaque black shadow or one with very little blur, which makes the design look "dirty" or dated. For a modern interface (Material Design or Apple-like):

Always use the RGBA format (black color 0,0,0) with a very low opacity (between 0.05 and 0.15), and compensate with a large blur radius (e.g. 20px to 40px). The shadow will look natural and diffuse, as if cast by a real ambient light source.

More UI design tools:

How it works

How to use the box-shadow generator

Create realistic CSS drop shadows (box-shadow) and copy the code.

  1. Adjust the shadow

    Offset, blur, spread, color and opacity.

  2. Preview

    The result is shown live.

  3. Copy the result

    Copy or download the result in one click.

FreeNo subscription, no hidden limits.
No sign-upOpen the page and use the tool. That’s it.
InstantResults in seconds, on mobile too.
PrivateEverything runs in your browser.

About the box-shadow generator

Soft, layered shadows add depth to an interface without weighing it down.

box shadow generator css box shadow css shadow generator drop shadow css box-shadow examples ui shadow generator inner shadow css
FAQ

Frequently asked questions about the box-shadow generator

What do the box-shadow values mean?

Horizontal offset, vertical offset, blur, spread, then color.

How do I make an inner shadow?

Add the inset keyword.

Can I combine several shadows?

Yes, separate them with commas.

Do shadows slow the site down?

Very little, unless a large number of them are animated.

Esc
↑ ↓ navigateEnter open