Guide
Build a shadow for a card, button or panel without writing every value by hand. This CSS Box Shadow Generator previews the same shadow value that it exports, including layered and inset effects. Edit one of up to eight layers at a time, try a preset and copy a complete CSS declaration. Generation runs in your browser without sending input values to a processing service.
1Adjust a shadow layer
Set horizontal and vertical offsets, blur radius, spread, HEX color and opacity. Use the sliders or enter precise decimal values in the labeled number fields.
2Preview inset or outset
Leave Inset unchecked for an outer shadow or enable it for a shadow inside the preview card. Switch the preview background between light and dark to compare the effect.
3Combine and arrange layers
Add up to eight layers, select one to edit and move layers up or down. The first listed shadow is painted above later shadows. At least one layer remains.
4Copy the generated CSS
Copy the complete box-shadow declaration and paste it inside a CSS selector. Test it on the actual element and its target screen sizes. Reset restores the default single-layer shadow.
The first two box-shadow lengths move the shadow horizontally and vertically. Positive horizontal values move it right; negative values move it left. Positive vertical values move it down, while negative values move it up. Zero centers that part of the shadow. This editor accepts offsets from -100px to 100px, making both directional and centered effects possible.
Blur softens the shadow edge. A 0px blur produces a sharp edge, while larger values make a wider, softer transition. Blur cannot be negative. The supported range here is 0px to 150px. Browser rendering and the surrounding colors affect the perceived softness; the blur value is not a promise of an exact visible edge distance.
Spread expands or contracts the shadow shape before blur is applied. Positive spread makes the shadow larger; negative spread makes it smaller. Unlike blur, spread can be negative. This Box Shadow Maker supports -100px to 100px. A zero-offset shadow with zero blur and a small positive spread can create a subtle border-like outline without changing layout.
An outset shadow appears outside the element's border box. Adding the inset keyword draws the shadow inside, which can suggest a recessed surface. Each layer has its own inset setting, so one declaration can combine outer depth and an inner edge. The preview card remains white when the surrounding preview background is switched to dark.
Separate shadows with commas to combine a close, crisp layer with a wider, softer layer. In this Multiple Box Shadow Generator, each layer keeps its settings as you select and reorder it. CSS paints the first listed shadow on top. Move a layer up or down deliberately because changing order can change how colors and opacity overlap. This editor keeps between one and eight layers.
Enter an opaque three- or six-digit HEX color, optionally without #, or use the native picker. Shorthand expands to six digits. Opacity is controlled separately from 0% to 100% and is exported in rgba() syntax: 25% becomes alpha 0.25. Pixel lengths and opacity percentages round to two decimal places, with up to four decimal places for the derived alpha. Invalid colors pause CSS generation.
Copy the generated box-shadow declaration into a rule such as .card { ... }. A shadow does not add layout space, so leave enough room around nearby elements. Border radius shapes the shadow corners, while an ancestor with clipped overflow may hide an outer shadow. The preview frame also crops extreme shadows at its edges without changing the copied values.
Large blurs and many overlapping shadows can increase painting work, especially across many elements or during animation. Use the fewest layers that achieve the effect and test on representative devices. Avoid using a subtle shadow as the only boundary when a component needs a clearly visible edge. Check text contrast, component states and focus indicators separately rather than treating a shadow as an accessibility guarantee.
box-shadow follows the element's box and rounded corners; it supports spread and inset. filter: drop-shadow() follows the rendered alpha silhouette, which can suit a transparent image or an irregular icon, and uses a different syntax without spread or inset. If you arrived looking for a CSS Drop Shadow Generator, this tool produces box-shadow declarations, not filter declarations.
Soft Shadow, Material Shadow, Deep Shadow, Floating Card, Subtle Border Shadow and Inner Shadow replace the actual editor layers and remain editable. Material Shadow is a local design preset rather than an official external design-system implementation. Sliders stay within their ranges. Leaving a numeric field clamps a finite decimal to its allowed range and rounds it; empty or malformed fields remain invalid until corrected.
- Adding depth to cards and dialog panels
- Creating an inner edge for a recessed surface
- Combining tight and diffuse shadows for a floating card
- Comparing subtle border-like shadows on light and dark preview backgrounds
- Preview the actual generated CSS for up to eight layers.
- Edit offsets, blur, spread, HEX colors and opacity with bounded controls.
- Combine inset and outset shadows with explicit stacking order.
- Copy a validated declaration or select the code manually if clipboard access is blocked.
What is CSS box-shadow?
box-shadow paints one or more shadows around an element's box. Each shadow can include horizontal and vertical offsets, blur, spread, color and an optional inset keyword.
How do I generate a box shadow?
Adjust the selected layer with the sliders or number inputs, choose a HEX color and opacity, then copy the complete declaration. Add more layers when a single shadow is not enough.
What is the difference between blur and spread?
Blur softens a shadow's edge and must be nonnegative. Spread changes the size of the shadow before blur; positive spread expands it and negative spread contracts it.
How do I create an inset shadow?
Select the layer and enable Inset shadow. The generated layer starts with inset and the preview draws its shadow inside the card. Other layers can still use outset shadows.
Can I use multiple box shadows?
Yes. Add up to eight layers and select each to edit it. Move layers up or down to change their order. The first layer is painted above later layers, and one layer must remain.
How do I change shadow opacity?
Use the selected layer's Opacity slider or number field from 0% to 100%. The generated rgba() color uses the equivalent alpha value; 0% is transparent and 100% is fully opaque.
Can I copy the generated CSS?
Yes. Copy CSS copies the complete box-shadow declaration when all layers are valid. If clipboard access is unavailable, select the code block and copy it manually.
Does box-shadow work in modern browsers?
Standard box-shadow declarations, including multiple layers and inset, work in modern browsers. Check the final element in your target browsers because rendering, clipping and layout can affect the result.
What is the difference between box-shadow and drop-shadow?
box-shadow follows a box and supports spread and inset. filter: drop-shadow() follows the rendered alpha silhouette and has different parameters. This generator produces box-shadow CSS only.
Is the CSS Box Shadow Generator free?
Yes. Editing, presets, previews and CSS copying are free without signup.