The quick answer
Four sliders and a colour picker drive a live preview card. The default 4px 6px 12px -2px #00000040 reads as a standard card elevation, and the output panel prints that outer shadow plus an inset variant, ready to copy. Offsets run -50 to 50px, blur 0 to 100px, spread -25 to 50px. Everything runs in your browser and nothing uploads.
CSS Box Shadow Generator, in plain terms
Box-shadow is the classic case of a property everyone can read and almost nobody can write blind: four lengths and a colour that only look right together once you see them. This generator closes that loop. You move the sliders, watch the preview, and copy the declaration when it looks right, all in the browser with nothing uploaded.
The controls map one-to-one onto the declaration: Offset X and Offset Y sliders (-50 to 50px), Blur (0 to 100px), Spread (-25 to 50px) and a colour picker whose output is always 8-digit hex. The picker sets the six hue digits; the two alpha digits stay fixed at 40, roughly 25% opacity, which is why the default shadow stays translucent over any background. The white preview card re-renders on every input, so what you copy is what you saw.
The rest of this page is the manual: step-by-step usage, the exact output format, a worked example, the accuracy limits, and the questions people actually search about box shadow generators.
Dialing in a shadow, step by step
Here is the complete workflow, from the default shadow to a declaration you can paste and trust. Everything happens live, with no calculate button and no page reload.
Start from the default shadow
The page loads with Offset X 4px, Offset Y 6px, Blur 12px, Spread -2px and the colour #00000040, a standard card elevation you can tweak from instead of building from zero.
Drag the offsets
Offset X and Offset Y (each -50 to 50px) move the shadow left and right, down and up; the white preview card re-renders as you drag, so a direction mistake is visible immediately.
Set blur and spread
Blur (0 to 100px) softens the edge: 0 is a hard-edged copy of the box, 100 a diffuse glow. Spread (-25 to 50px) grows or shrinks the shadow box itself; negative values like the default -2px tighten it for a crisp edge.
Pick the colour
The colour picker sets the hue as six hex digits, and the output keeps the alpha digits at 40, so the shadow stays translucent at about 25% opacity. Want it lighter or heavier? Edit the last two digits after pasting.
Copy the output
The output panel prints the outer shadow, a one-line comment and an inset variant (same x, y and blur, no spread). The Copy button puts the whole block on your clipboard, ready for your stylesheet.
Close the tab when you are done
Nothing is stored: the slider values live in your browser only, and closing the tab discards them.
That is the entire workflow. Every intermediate result is visible in the preview, so you never have to trust a black box; you can check the working at any point.
Worked output you can paste today
This is the generator's default, copied from the output panel exactly as the Copy button hands it over, comment line included. The inset variant shares the same x, y, blur and colour and drops the spread value.
box-shadow: 4px 6px 12px -2px #00000040;
/* plus inset for a pressed look */
box-shadow: inset 4px 6px 12px #00000040;Real jobs this generator handles
Three scenarios cover the jobs the tool most often serves.
Frontend developers: elevation scales are shadows with disciplined numbers, 2px 4px 8px for cards and 8px 16px 32px for modals. Dialling the pair in visually and copying both declarations keeps the design tokens consistent instead of eyeballed per component.
Product designers: handing off a shadow spec as an exact declaration beats a note like "soft drop shadow, medium". The developer pastes the numbers and the build matches the mock on the first try.
No-code builders: page builders expose a shadow field but rarely the full parameter set. Generating the declaration here and pasting it into the custom CSS box gives the same control the designer had.
Accuracy limits worth knowing
Trustworthy output includes its own fine print. Here are the boundaries people hit in practice.
- The shadow disappears in dark mode: black-based shadows vanish against dark backgrounds. Switch the picker to a lighter hue and re-copy, since the declaration the tool prints is exactly what the browser renders.
- The shadow clips on the parent: an ancestor with overflow: hidden can cut a shadow off. The generator's numbers are correct, and the clipping is a layout issue above the element.
- The preview shows only the outer shadow: the inset variant exists in the output text but not on the preview card, so judge inset looks after pasting.
Nothing here is estimated. The declaration is your four slider values and the picked colour, printed exactly as the browser will receive them.
Privacy: nothing leaves the tab
There is nothing sensitive about a shadow, but the guarantee is the same as for every tool on this site: the preview and the declaration are computed locally in your browser, nothing you dial in becomes a network request, and closing the tab resets it. If the elevation style belongs to an unreleased redesign, that is enough to make local-only processing worth having.
How this compares with the alternatives
| Alternative | Where it wins | Where this tool wins |
|---|---|---|
| Shadow-generator one-pagers (cssmatic, cssgenerator.org) | Some layer multiple shadows and ship material-style elevation presets | Prints the outer shadow and an inset variant together against a live preview, with no signup wall |
| Browser DevTools element inspector | Tweaks shadows on your real page, in situ, with your real colours and sizes | Builds a shadow before the element exists; paste the declaration straight into the stylesheet instead of reverse-engineering it from the Styles pane |
| Figma and design tools | Shadow pickers live inside the mock, next to the rest of the design | Emits the CSS declaration directly, so nobody translates visual blur into lengths by hand when the mock reaches the build |
DevTools wins on real pages and Figma wins inside the mock. This page is for the moment you need the declaration itself, quickly and privately.
Shadow habits worth keeping
Two habits and two gotchas cover most of the day-to-day value.
- Bookmark the page if the job recurs: repeat users save real time when the tool is one keystroke away, and the page loads instantly from cache on return visits.
- Start from the default values: the default shadow is a known input with a known output that validates your understanding in ten seconds before you trust the tool with real design decisions.
When a result behaves unexpectedly, the causes are usually one of these:
- Two stacked shadows overlap into mud: when you layer declarations, the first shadow in the list paints on top, so put the crisp one first and the larger, more transparent one second.
- The shadow looks fuzzy on low-contrast backgrounds: very light alpha plus a small blur can band; nudging the alpha up and the blur down keeps the edge readable.
When the tool misbehaves in a way this page did not predict, the contact page takes bug reports.
Frequently asked questions
These are the questions people actually search about box shadow generators, answered directly. If yours is missing, the contact page takes feature and question requests.
Can I stack multiple shadows on one element?
Yes. Box-shadow accepts a comma-separated list, and the first shadow in the list paints on top. The output panel prints one shadow plus an inset variant; to build a layered elevation, paste the declaration and append a second, larger and more transparent set of values after a comma.
Is the CSS Box Shadow Generator free to use?
Yes, completely free, with no signup and no email gate. The generator runs entirely in your browser, so each extra use costs this site nothing and costs you nothing either. The only limit is the one your browser itself imposes.
Can I use the CSS Box Shadow Generator offline?
In practice, yes: load the page once and it remains usable on a plane or in a dead zone, because the sliders, the preview and the Copy button all work locally and no part of the computation needs the network.
What shadow does the page load with by default?
4px 6px 12px -2px #00000040: offset 4px right and 6px down, 12px of blur, a slightly negative spread to keep the edge crisp, and black at 25% alpha. It reads as a standard card elevation, and the output panel also prints an inset variant (same x, y and blur, no spread) for pressed-button looks.
Does the shadow colour support transparency?
Yes, in a fixed way: the output is always 8-digit hex like #00000040, and the colour picker sets the six hue digits while the two alpha digits stay 40, which is about 25% opacity. To dial the opacity itself, edit those last two digits after pasting; 00 is fully transparent and FF is opaque.
What is the difference between blur and spread?
Blur softens the shadow's edge: at 0 the shadow is a hard-edged copy of the element's box, and at 100px it dissolves into a soft glow. Spread grows or shrinks the shadow's box itself, so positive values fatten it around the element and negative values (like the default -2px) tighten it inward.
Can I generate an inset shadow?
Yes, on every copy. The output panel prints the outer shadow and an inset variant built from the same x, y, blur and colour, with the spread value dropped from the inset line. Inset shadows draw inside the element's border box, which is what gives pressed and engraved button looks.
Tools that pair with CSS work
These tools share the workflow most often: the links exist because people genuinely chain them, not for keyword decoration.
- CSS Border Radius Generator: the other half of card styling; set the corners and the shadow from the same preview loop.
- Color Converter (HEX/RGB/HSL): convert the shadow colour to HSL when you want to tune hue and lightness instead of hex digits.
- CSS Flexbox Generator: lay out the components the shadows sit under, with live container controls.
- CSS Grid Generator: build the card grid the shadows sit on, with three sliders and the same copy flow.
Sources for the box-shadow details
Every design choice here serves one goal: a fast, trustworthy box shadow generator. It is fast because the work is local, trustworthy because the output format is documented with an example you can re-run, and private because there is no server in the loop. Run your real elevation workload through it, and pass anything odd to the contact page.
Sources and further reading
- MDN Web Docs: box-shadow property reference(developer.mozilla.org)
- W3C: CSS Backgrounds and Borders Module (shadows)(w3.org)
- MDN Web Docs: color values and 8-digit hex alpha(developer.mozilla.org)
- Material Design: elevation and shadow guidelines(m3.material.io)
- web.dev: CSS box-shadow performance notes(web.dev)
We cite primary sources (standards bodies, government agencies, official documentation) wherever they exist so you can verify every number on this page yourself.