1. Home
  2. Design tools
  3. Box Shadow Generator

Box Shadow Generator

Stack soft shadows to get the natural depth used in modern interfaces, and copy production-ready CSS.

Free, no sign-up. Runs in your browser: nothing is uploaded.

Free workspace included. Docs, spreadsheets, notes and tasks that save on your device. No sign-up.Take a look

How to use Box Shadow Generator

  1. Adjust offset, blur, spread and color.
  2. Add layers for smoother depth.
  3. Copy the CSS.

Features

  • Multiple layers
  • Inset shadows
  • Elevation presets
  • Light and dark previews

Supported formats

You get

  • CSS

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Box Shadow Generator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Guide

Realistic CSS box shadows for cards, buttons and modals

Shadows tell people what’s on top: a card above the page, a menu above the card, a dialog above everything. Good shadows are barely noticed; bad ones look like gray smudges. This generator lets you build shadows layer by layer, preview them on light and dark backgrounds, and copy the CSS.

Building a shadow

  1. Start from a preset (Subtle, Card, Raised, Floating, Inset or Glow) or adjust the current one.
  2. For the selected layer, set:
    • Horizontal and Vertical offset: where the light comes from. Most interfaces use a small downward offset, as if light came from above.
    • Blur: how soft the edge is.
    • Spread: grows (positive) or shrinks (negative) the shadow before blurring.
    • Color and Opacity.
    • Inset: puts the shadow inside the box.
  3. Add layers for more realism; select a layer to edit it, or remove it.
  4. Toggle the dark background to check how it looks in dark mode.
  5. Copy CSS and paste it into your stylesheet.

Why layered shadows look real

A real object casts a small, dark shadow right underneath and a wider, fainter one further out. One layer can’t do both. The Card and Raised presets combine a tight, low-blur shadow with a larger, softer one, each at low opacity, for example:

box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.06), 0px 4px 12px -2px rgba(0, 0, 0, 0.1);

Negative spread on the larger layer keeps the shadow from peeking out at the sides, so it appears mostly below the element.

An elevation scale

Use a small set of shadows consistently, so depth means something:

Level Preset Use for
1 Subtle Inputs, list items, flat cards
2 Card Cards, panels, tiles
3 Raised Hovered cards, dropdown menus
4 Floating Dialogs, popovers, toasts

Save the four values as CSS variables (such as --shadow-1 to --shadow-4) and use only those across the site.

Inset and glow

  • Inset shadows make elements look pressed in: text fields, toggles in the “on” state, wells.
  • Glow uses a colored shadow with no offset and a wide blur, effective for focus states, highlighted buttons or neon-style designs. Keep it subtle in interfaces.

Shadows and dark mode

Shadows are nearly invisible on dark backgrounds. Preview with dark background on. In dark themes, elevation usually comes from slightly lighter surfaces and thin borders, with shadows used sparingly at higher opacity.

Tips

  • Shadow color: pure black at low opacity works, but a very dark version of the background hue looks richer on colored backgrounds.
  • Match the light source: use the same direction across the whole interface.
  • Performance: static shadows are cheap; avoid animating box-shadow on many elements. For hover effects, animate the opacity of a pseudo-element that holds the larger shadow.
  • Border radius: shadows follow the element’s rounded corners automatically.

Who designs shadows

  • Front-end developers style cards, dropdowns, modals and buttons.
  • UI designers define a consistent elevation scale for a design system.
  • No-code site builders paste custom CSS into website builders.
  • Students learn CSS by seeing how each value changes the result.

A complete example: a card with a hover effect

  1. Start with the Card preset for the resting state and copy the CSS.
  2. Switch to Raised for the hover state and copy that CSS too.
  3. In your stylesheet, apply the first to .card and the second to .card:hover, with a short transition.
  4. Check both on light and dark backgrounds with the preview toggle.

Tips

  • Use the same few shadow levels throughout a site.
  • Shadows should get larger and softer as elements rise higher.

Checked against the current version of the Box Shadow Generator on .

Troubleshooting

The download did not start

Look for your browser’s download bar or icon. Some browsers ask once before a site may download files; allow it and click the button again.

Frequently asked questions

What do the box-shadow values mean?

In order - horizontal offset, vertical offset, blur radius, spread radius and color. Positive offsets move the shadow right and down; blur softens the edge; spread grows or shrinks the shadow before blurring; inset puts the shadow inside the box.

Why use more than one layer?

Real shadows have a sharp, dark area close to the object and a wide, faint area further away. Combining a small, tight shadow with a large, soft one, both at low opacity, looks much more natural than one heavy shadow.

Why does my shadow disappear in dark mode?

Dark shadows barely show on dark backgrounds. Use the dark background preview to check, and in dark mode rely more on lighter surface colors or a subtle border for separation, or increase the shadow's opacity.

Do box shadows slow down a page?

Static shadows are cheap. Very large blur values on many elements, or animating box-shadow on hover, can cost performance on slower phones. For hover effects, consider animating opacity or transform instead.

Why use several shadow layers?

Real shadows have a sharp core and a wide soft falloff; two or three layers look far more natural than one.

Keep working with the result

After you download, choose “Save to Workstand” to keep the result in a folder on your computer, attach it to a project and create a follow-up task. It is saved by your browser, not uploaded.