The CSS Box Shadow Generator creates one copy-ready CSS box-shadow declaration in your browser.
Use it to preview an outer or inset shadow, tune the values without writing CSS by hand, and paste the exact declaration into a rule for an element that accepts the box-shadow property. The preview and serialized code update locally, keeping the workflow focused on the declaration you are designing.

A No-Account Workflow That Stays Local
Open the CSS Box Shadow Generator and start adjusting the controls directly. The visual sample shows the current shadow on a card, while the declaration below it reflects the same value in CSS syntax.
The preview and serialized code update locally in the browser. No CSS, color choice, or clipboard content is sent to a server. The sample applies the generated value as an inline style only for its local preview, while the copyable result is plain declaration text.
Settings are not remembered after the page reloads, so treat the generator as a focused scratchpad for each shadow. Save any declaration you want to keep in your own stylesheet or notes rather than expecting the tool to maintain a project history.
Set the Shadow Controls with Purpose
Each control changes a specific part of the CSS component model. Stay within the displayed limits and adjust one variable at a time when you need to understand its effect.
| Control | Accepted range or format | What it changes |
|---|---|---|
| Horizontal offset | -200 to 200 pixels | Positive values move an outer shadow to the right; negative values move it left. |
| Vertical offset | -200 to 200 pixels | Positive values move an outer shadow downward; negative values move it upward. |
| Blur radius | 0 to 200 pixels | Controls edge softness. Zero creates a hard edge, while larger values soften and expand the visible transition without changing the explicit spread value. |
| Spread radius | -100 to 100 pixels | Positive values expand the shadow shape before blur; negative values contract it and can make an outer shadow difficult to see. |
| Color | Six-digit hexadecimal value | Supplies the red, green, and blue channels that are converted to decimal rgba components. |
| Opacity | 0 to 100 percent | Becomes an alpha value from 0 through 1, rounded to at most three decimal places. |
| Inset | Enabled or disabled | Switches between an outer shadow and one drawn inside the element's border edge. |
Blur and spread affect the visible footprint in different ways. Blur changes the softness of the edge, while spread changes the shadow shape before that softening occurs. A large blur can make a shadow appear broader even though its configured spread has not changed.
A shadow with zero opacity remains present in the declaration but is invisible. For inset shadows, the same offset controls affect the perceived inner direction: a positive horizontal value appears to move the inner shadow left, while a positive vertical value appears to move it upward.
Read the Deterministic CSS Output
The output follows a fixed component order: optional inset first, followed by horizontal offset, vertical offset, blur radius, spread radius, and the rgba color. This order follows the W3C CSS Backgrounds and Borders box-shadow specification, so the generated text can be inspected and reused without sorting the values yourself.
For one complete example, the generated declaration is box-shadow: 4px 8px 16px 0px rgba(0, 0, 0, 0.25);. The horizontal offset is 4 pixels, the vertical offset is 8 pixels, the blur radius is 16 pixels, the spread radius is 0 pixels, and the rgba color contains black with a partially transparent alpha channel.
The color control accepts a six-digit hex value, converts its channels to decimal, and combines them with the selected opacity. The declaration includes the box-shadow property but does not generate a selector, a complete style rule, an HTML fragment, a style tag, vendor prefixes, or JavaScript.
The MDN box-shadow reference is useful for checking the property syntax and understanding how the values interact in a real page. The generator handles the basic declaration, while the destination component determines how that declaration ultimately appears.
Create a Box Shadow Without Signing Up
- Open the generator and begin with the horizontal and vertical offset controls. Set the direction and distance that place the shadow beneath or beside the component as intended.
- Adjust the blur and spread separately. Use blur to control softness and spread to expand or contract the shadow shape before blurring.
- Choose a six-digit hex color and set the opacity. Check that the selected transparency still produces a visible effect against the background where the component will appear.
- Enable the inset option only when the shadow needs to sit inside the border edge, such as for a pressed control or recessed panel.
- Inspect the sample card and read the exact generated declaration below it. Confirm that the preview and copied values represent the shadow you intend to use.
- Copy the CSS and paste it into the intended selector. Then test the real component across themes, sizes, focus states, and browsers rather than relying on the sample card alone.
When the declaration is placed in a stylesheet, check whether another later rule overrides it. The generator does not modify project files, merge styles, or test a production stylesheet; it supplies one deterministic property value for you to integrate and review.
Choose Between Outer and Inset Effects
The inset choice changes more than the position of the shadow. It changes whether the effect suggests an elevated surface or a surface pressed into its frame.
| Effect | Visual behavior | Typical use |
|---|---|---|
| Outer shadow | Appears outside the element's border edge and follows the horizontal and vertical offsets. | Raised cards, dialogs, menus, or controls that need separation from their surroundings. |
| Inset shadow | Appears inside the element's border edge and uses the same offset controls with an inner perceived direction. | Pressed controls, recessed panels, inner highlights, and other depth cues. |
For a restrained starting point, use modest offsets, a blur larger than the offset, zero or small spread, and low opacity. Preview the value on a background similar to the final destination. A dramatic shadow can reduce clarity, detach the component from the page, or create a hierarchy that the interface does not otherwise support.
Test the Shadow in Its Real Interface
The sample is useful for tuning, but the destination supplies the background, border radius, dimensions, and surrounding content that determine whether the shadow works. After pasting the declaration into the intended rule, review the component in every relevant state.
- Check light and dark themes, including the contrast of surrounding text and controls against the actual background.
- Inspect default, hover, active, disabled, and focus states so the shadow does not obscure or compete with an important focus indicator.
- Review the result in high-contrast settings and, where relevant, reduced-transparency preferences.
- Test multiple component sizes, including content that expands the element or changes its proportions.
- Compare supported browsers and actual target devices. Rendering can vary slightly with pixel density, transforms, zoom, compositing, and the shape of the element.
Use shadows to reinforce structure rather than carry essential meaning alone. A user should still understand the component’s state, boundary, and purpose when the shadow is absent, difficult to see, or rendered differently by the browser.
Know Where the Small Tool Ends
The generator is deliberately bounded, which makes its output predictable but also defines what it does not produce.
- It creates one shadow layer at a time. CSS can contain comma-separated multiple shadows, but combining and ordering layers is outside the tool.
- It does not generate a selector, style tag, HTML fragment, vendor prefix, or JavaScript. The copied result is plain box-shadow text.
- It does not detect browser targets, run an autoprefixer, or add legacy -webkit- or -moz- prefixes. Modern browsers generally support the unprefixed property, but the destination still needs testing.
- It does not test a production stylesheet, create Tailwind classes, define design-system variables, produce animation keyframes, or generate multiple elevation tokens.
- It does not create text shadows or filter: drop-shadow() effects. Its output is specifically the CSS box-shadow property.
- It does not edit project files or preserve settings after reload.
Use it when you need a single, standards-shaped shadow value. For more complex shadow stacks or browser-targeting automation, treat the copied declaration as one controlled component and handle those broader requirements elsewhere.
For a deeper look, see How to Make Round Button CSS in 5 Practical Steps.
For a deeper look, see Free Clip Path Generator: Polygon CSS Without Sign-Up.