Miscellaneous Tools

CSS Box Shadow Generator

Create simple or complex multi-layer CSS box shadows visually. Adjust offsets, blur, spread, colors, and opacity with real-time preview, instant CSS copy, and download.

Shadow Layers

2 Layers

Combine multiple shadow layers to achieve realistic, soft optical depth. Click any layer to edit:

Edit Layer Settings

Shadow Direction Mode Choose between exterior drop shadow or inner inset shadow
-100px to +100px
px
-100px to +100px
px
0px (sharp) to 150px (soft)
px
-50px to +100px
px
#
12%
%

Live Shadow Preview

Preview Appearance Controls
#
#
CSS Output Code
/* Calculating CSS... */
Standard W3C CSS3 Syntax

Curated Shadow Presets

14 Styles

Click any preset to instantly apply its offsets, blur, spread, and layer combinations:

Complete CSS Box Shadow Syntax & Developer Guide

CSS3 Specification

The CSS box-shadow property attaches one or more drop-shadow effects around an element’s frame. Mastering offsets, blur, spread, and multi-layer optical blending is crucial for creating modern, professional web interfaces.

Standard Box Shadow Syntax Formula: box-shadow: [inset] <offset-x> <offset-y> <blur-radius> <spread-radius> <color>;

1. Offset X & Offset Y

Offset-X shifts the shadow horizontally (positive moves right, negative moves left). Offset-Y shifts the shadow vertically (positive moves down, simulating a light source from above, negative moves up).

2. Blur & Spread Radius

Blur radius applies a Gaussian blur smoothing the shadow edges (0px produces a crisp silhouette). Spread radius expands (positive) or contracts (negative) the shadow shape before blurring.

3. Multi-Layer Depth

Single shadows often appear harsh or muddy. Modern UI design stacks two layers: a tight, darker shadow for contact definition, plus a large, soft ambient shadow for realistic atmospheric elevation.

Parameter Type / Unit Default Description
inset Keyword (optional) Outset (default) Draws the shadow inside the border frame (sunken/depressed look).
offset-x Length (px, em, rem) Required (0px) Horizontal displacement along the X-axis.
offset-y Length (px, em, rem) Required (0px) Vertical displacement along the Y-axis.
blur-radius Length (px) ≥ 0 0px (sharp) Radius of the Gaussian blur algorithm applied to the shadow perimeter.
spread-radius Length (px) 0px Grows or shrinks the shadow footprint prior to blurring. Negative spread prevents side bleed.
color Color (HEX, RGB, RGBA, HSL) currentColor Color of shadow. Best practice is semi-transparent rgba(0,0,0, 0.05 - 0.20).

Frequently Asked Questions

FAQ & Troubleshooting

The CSS box-shadow property allows web developers to render drop shadows around an HTML element’s frame. It accepts horizontal and vertical offsets, an optional blur radius, an optional spread radius, and a color value. Multiple shadows can be chained using commas to create lifelike 3D depth.

To make shadows look natural rather than dirty or harsh, use a two-layer technique: Layer 1 uses a small vertical offset (e.g., 2px-4px) with subtle opacity (4%-8%) for crisp edge definition, while Layer 2 uses a larger offset (e.g., 10px-20px), larger blur (20px-30px), negative spread (-3px to -5px), and light opacity (8%-12%). This replicates optical light physics.

Blur radius controls the softness and feathering of the shadow edge—the higher the number, the more diffused the shadow. Spread radius actually resizes the solid footprint of the shadow before it gets blurred. A positive spread makes the shadow larger than the element, while a negative spread shrinks it inwards so it does not spill over the sides.

Adding the inset keyword changes the shadow rendering from an exterior drop shadow to an internal shadow drawn within the element’s padding box. Inset shadows are widely used for pressed buttons, sunken form input fields, well containers, and neumorphic tactile UI designs.

Yes! The CSS specification allows any number of box-shadow declarations separated by commas. The shadows are rendered in top-to-bottom order: the first shadow listed in the rule is drawn on top of subsequent shadows. This PaceTools generator allows you to add, reorder, duplicate, and toggle unlimited shadow layers visually.

All modern web browsers (Chrome, Edge, Firefox, Safari, iOS Safari, and Android) have fully supported standard box-shadow without prefixes since 2012. However, including -webkit-box-shadow ensures backward compatibility with legacy WebKit browsers and embedded Android WebViews. Our tool provides a toggle so you can include or omit it as desired.

When simulating an overhead light source with vertical offset (e.g. offset-y: 16px), a positive or zero spread will cause the shadow to visibly peek out of the left, right, and top edges. Using a negative spread (e.g. -4px) shrinks the lateral footprint so the shadow only emerges beneath the element, matching natural light shadows.

No. PaceTools CSS Box Shadow Generator is 100% free, runs entirely inside your browser, and requires no registration or server uploads. You can preview shadows in real time, copy clean CSS, or download a .css stylesheet file immediately.
Copied CSS to clipboard!