Box Shadow Generator
Design CSS box-shadows with a live preview
Box Shadow Generator tool
box-shadow: 8px 8px 24px 0px rgba(15, 23, 42, 0.25);
Box Shadow Generator: key facts
- What it does
- Design CSS box-shadows with a live preview
- Category
- Generators
- Cost
- Free, with no account, sign-up, or install.
- Your data
- Runs entirely in your browser — the files and text you enter are never uploaded to a server.
- Last reviewed
- . Report an incorrect result.
What the Box Shadow Generator does
The CSS box-shadow property packs five values plus a color into one line, and small changes to any of them completely change the feel of a shadow. This generator turns those numbers into sliders with a live preview, so you can dial in exactly the depth you want and read off the CSS.
You control horizontal and vertical offset, blur radius, spread radius, and a separate opacity slider that the tool folds into an rgba() shadow color — so you adjust transparency without editing hex codes by hand. An inset toggle flips the shadow inward for pressed or recessed effects, and a background color picker lets you preview the shadow against the surface it will actually sit on.
It is the go-to for building a subtle card elevation, a glowing focus ring, or the soft double-shadow look of neumorphic UI. Designers and developers use the preview to judge contrast before copying the box-shadow declaration straight into their stylesheet.
Using the Box Shadow Generator, step by step
- Drag the horizontal and vertical offset sliders to push the shadow left/right and up/down.
- Set the blur radius for softness and the spread radius to grow or shrink the shadow.
- Lower the opacity slider for a subtle shadow or raise it for a bold one.
- Pick the shadow color and a preview background color to check real-world contrast.
- Toggle "Inset shadow" if you want the shadow inside the box, then click "Copy CSS".
Five values, and what each does
A box shadow takes horizontal and vertical offset, a blur radius, an optional spread, and a colour — plus an optional inset keyword that draws the shadow inside the element rather than outside. The generator assembles those into a rule and previews the result.
The two that get confused are blur and spread. Blur softens the shadow's edge over the given distance without changing its size; spread grows or shrinks the shadow before the blur is applied, so a negative spread pulls it in. Using spread where you meant blur produces a hard-edged block.
Offsets position the shadow, and their direction implies a light source — which is why consistency across an interface matters more than any individual value.
- 0 1px 2px with low opacity reads as a subtle lift off the page.
- A larger blur with greater vertical offset suggests an element floating higher.
- inset draws the shadow inward, which is how pressed and recessed states are built.
What makes this one worth using
- Pure client-side React: no upload, no account, and the emitted box-shadow is standard CSS that works in any project.
- The dedicated opacity slider is merged into an rgba() color for you, so you tune transparency without hand-editing alpha values.
- A configurable background behind the preview box reveals whether a pale shadow actually shows up on your real surface color.
- Inset support and spread control mean you can build pressed states and neumorphic shadows, not just simple drop shadows.
Shadows that look like light
Convincing shadows follow physics loosely. Light in an interface conventionally comes from above, so vertical offset should be positive and horizontal offset near zero — a shadow offset sideways reads as odd unless the whole interface agrees. Objects further from the surface cast larger, softer, fainter shadows, so elevation should increase blur and offset together while reducing opacity, not increase darkness.
The most common mistake is a shadow that is too dark and too tight. Real shadows are diffuse; a black shadow at high opacity with little blur looks like a border rather than depth. Low opacity with generous blur is almost always better, and layering two or three shadows — a tight faint one for contact, a wide soft one for elevation — is how the best interfaces achieve realism.
Two practical points. Define a small set of elevation levels and reuse them rather than inventing values per component; that consistency is what makes an interface feel coherent, and it is why design systems ship shadow tokens. And animating box-shadow is expensive because it forces repaints — animating the opacity of a pseudo-element carrying the shadow is the standard performant alternative.
Frequently Asked Questions
What does spread radius do in a box-shadow?
Spread grows or shrinks the shadow before the blur is applied. A positive spread makes the shadow larger than the element, useful for glows; a negative spread pulls it in, which helps create shadows that only peek out from one side.
How do I make a soft, subtle shadow?
Use a small vertical offset, a generous blur radius, zero or slightly negative spread, and a low opacity around 10–20%. Large blur with low opacity reads as a gentle elevation rather than a hard outline.
What is an inset shadow used for?
An inset shadow renders inside the element instead of behind it, making the box look recessed or pressed in. It is common for input fields, toggled buttons, and the inner shadow half of a neumorphic design.
Can I stack multiple shadows?
CSS supports comma-separated multiple shadows, and full neumorphism uses a light and a dark one together. This tool builds one shadow at a time; copy two results and join them with a comma in your stylesheet to layer them.