CSS Box Shadow Generator

Build a CSS box-shadow visually — offset, blur, spread, colour, opacity and inset — with presets, and copy the code.

Last updated:

Preview

Box shadow generator

A good shadow lifts cards, buttons and pop-ups off the page — a bad one looks muddy. This box shadow generator lets you tune every part of the CSS box-shadow with sliders: horizontal and vertical offset, blur, spread, colour and opacity, plus inset for pressed-in effects. Start from presets such as Subtle, Floating, Hard retro or a realistic two-layer shadow, check it on your own box and corner radius, and copy ready-to-paste CSS.

How to use it

  1. Pick a preset or move the sliders.
  2. Set the box colour and corner radius to match your design.
  3. Copy the CSS into your stylesheet.

Example

box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.18); is a soft shadow that suits most cards: it sits 8px below the box, blurs over 24px and is 18% black. Pair it with a background from the CSS gradient generator, and check colour codes with the colour converter.

Rate this tool

Frequently asked questions

What do the box-shadow values mean?
In order: horizontal offset, vertical offset, blur radius, spread radius and colour — for example 0 4px 12px 0 rgba(0,0,0,0.15). Positive offsets move the shadow right and down; blur softens it; spread grows or shrinks it.
What is an inset shadow?
The inset keyword draws the shadow inside the box instead of outside, making it look pressed in — useful for input fields and toggles.
How do I make a soft, realistic shadow?
Use a low-opacity dark colour (10–20%), a vertical offset only, and a blur roughly two to three times the offset. Layering two shadows — one tight, one wide — looks even more natural; the “Layered” preset does this.
Do box shadows slow a page down?
Not noticeably for normal use. Very large blurs on many elements can make scrolling less smooth on low-end phones, so keep them moderate.