Box Shadow Generator
Box Shadow Generator designs CSS shadows visually with X/Y offset, blur, spread, opacity and inset controls, locally in your browser.
About this tool
Slider values assemble [inset] Xpx Ypx Blurpx Spreadpx rgba(r, g, b, alpha) and apply it directly to the preview card while keeping the CSS declaration synced. Fine-tune card elevation tokens in real browser lighting.
How to use the box shadow generator
- Move the horizontal and vertical offsets to choose which side the shadow falls on.
- Raise the blur radius for a softer edge, and the spread to make the shadow larger or smaller.
- Set the opacity, then tick Inset shadow to draw the shadow inside the box.
- Watch the live card, then copy the CSS rule into your stylesheet.
How CSS box shadows are built
The CSS box-shadow property takes up to six values: horizontal offset, vertical offset, blur radius, spread radius, colour and an optional inset keyword. A positive horizontal offset moves the shadow to the right, and a positive vertical offset moves it down. A larger blur makes the edge softer, and a negative spread shrinks the shadow inside the box, which often looks cleaner.
Layered shadows are common in modern interfaces. Two soft shadows, one close and one far, look more natural than a single hard shadow, and they can be combined in one rule separated by commas.
A worked example
The default values, a 0 offset horizontally, 8 pixels down, a 24 pixel blur, a negative 4 pixel spread and 12 per cent opacity, give a soft shadow that sits under a card without a harsh edge. Turning on the inset option moves the same shadow inside the card, which suits a pressed button.
- Use a soft shadow under a product card to lift it from the page.
- Add an inset shadow to an input field to show that it is active.
Who uses a box shadow generator
- Front-end developers building cards, panels and buttons.
- Designers testing elevation levels before a design hand-off.
- Students learning how CSS effects are written.
- Teams keeping a consistent elevation scale across a product.
- Anyone who wants a subtle shadow without trial and error.
Tips and common mistakes
- Very dark shadows look heavy on light backgrounds. Keep the opacity low for most cards.
- Shadows add paint work in the browser. Avoid very large blur values on long lists.
- Check the shadow on a dark theme too, because the same values can disappear against a dark background.
- Use the copied rule as a starting point, then match it to your design tokens.
- The shadow is drawn in your browser, and the CSS is generated locally.
Frequently asked questions
Aspect Ratio Calculator
Aspect Ratio Calculator simplifies ratios using the GCD, scales pixel dimensions proportionally and copies CSS aspect-ratio rules, in your browser.
Color Converter
Color Converter translates colors between HEX, RGB, HSL and CSS OKLCH with a live swatch preview and RGB sliders, locally in your browser.
WCAG Contrast Checker
WCAG Contrast Checker tests foreground and background color pairs against WCAG 2.1 AA and AAA ratios, with live preview cards in your browser.
No matching tools. Clear the filter to see all.