Skip to content
M2TOOLKIT

Box Shadow Generator

Design soft, realistic CSS shadows with a live preview.

Use it as often as you like — it's free, with no sign-up and no limits.

  • Design
  • Free
  • No sign-up
  • Runs in your browser
  • Updated
0px
12px
28px
-12px
22%

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us.

How to use the Box Shadow Generator

  1. Adjust offset, blur and spread.
  2. Pick the color and opacity.
  3. Copy the CSS.

What does this tool do?

Subtle shadows use a small vertical offset, a large blur and a negative spread, with low opacity. That's what makes cards look gently raised rather than heavily outlined.

Why use it?

  • Cards, modals and buttons.
  • See the result before you code it.
  • Inset shadows for pressed states.

Use cases

  • Raised cards and modals.
  • Hover and focus states.
  • Layered depth in dashboards.

A soft card shadow

box-shadow: 0px 12px 28px -12px rgba(21, 23, 27, 0.22);

Common mistakes

  • Dark, hard shadows that look dated.
  • Using shadows as the only border on light backgrounds.
  • Animating box-shadow on many elements, which can be slow.

Privacy

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.

Frequently asked questions

Does box-shadow affect layout?

No. Shadows are drawn outside the element without taking up space, so they don't push other elements around. They can be clipped by a parent with overflow: hidden.

Can an element have more than one shadow?

Yes. Separate shadows with commas in the CSS. Layering a small, sharp shadow with a large, soft one often looks more natural than a single shadow.

What does inset do?

It puts the shadow inside the element, making it look pressed in.

How do I make a soft, realistic shadow?

Layer two shadows: a small, tight one and a large, very faint one.

Content last updated . See how M2Toolkit works.

Other tools people use alongside the box shadow generator.