Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
L
Loopaloo

Free online tools for developers, designers, and content creators. Your files are processed in your browser and are never uploaded - no accounts required. A few network utilities (like What's My IP and Currency Converter) call public APIs to do their job and say so on their pages.

support@loopaloo.com

Tool Categories

  • Image Tools
  • Audio Tools
  • Video Tools
  • Document & Text
  • PDF Tools
  • CSV & Data
  • Converters
  • Web Tools
  • Math & Science
  • Games

Company

  • About Us
  • Contact
  • Blog
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer

Support

Buy Us a Coffee

© 2026 Loopaloo. All rights reserved. Built with privacy in mind.

Privacy|Terms|Disclaimer
  1. Home
  2. Web Tools
  3. CSS Box Shadow Generator
Add to favorites

CSS Box Shadow Generator

Stack CSS box shadows with any colour notation, and never write a declaration the browser will drop: a layer that will not parse is left out and flagged rather than taking every other layer down with it

Runs locally in your browserMore web toolsJump to full guide

Related reading

  • CSS Box Shadows: From Subtle Depth to Dramatic Effects12 min read

Initializing in your browser…

You might also like

CSS Button Generator

Design a CSS button and see every state measured against WCAG on the page colour you name: resting, hover, active, focus and disabled, plus the focus ring and the border.

Mock Data Generator

Generate fake data that is the thing it is labelled: card numbers with a real Luhn check digit, IBANs that pass ISO 7064 MOD 97-10, UUID v4 and v7 per RFC 9562, reserved e-mail and IP ranges, a seed so the same data comes back, and JSON, NDJSON, CSV or SQL output

CSS Gradient Generator

Build a CSS gradient and choose the colour space it is interpolated in, with the colour it keeps through the middle measured and shown.

CSS Box Shadow Generator: a worked example

The same shadow written with five different colour notations, each put past the browser's own CSS parser. The verdicts below are what Chrome returned on 2026-09-04.

Typed into the layer colour field

#000000, #f00, red, rgb(255 0 0), #3b82f680
What CSS Box Shadow Generator produces

What each one produced, before and after this pass

typed          before                        browser   after                     browser
#000000        rgba(0, 0, 0, 0.5)            accepts   rgb(0 0 0 / 0.5)          accepts
#f00           rgba(240, 0, NaN, 0.5)        DROPS     rgb(255 0 0 / 0.5)        accepts
red            rgba(237, NaN, NaN, 0.5)      DROPS     rgb(255 0 0 / 0.5)        accepts
rgb(255 0 0)   rgba(NaN, NaN, 85, 0.5)       DROPS     rgb(255 0 0 / 0.5)        accepts
#3b82f680      rgba(59, 130, 246, 0.5)       accepts   rgb(59 130 246 / 0.251)   accepts

"DROPS" means the browser threw away the WHOLE declaration, every layer of it, silently.
The last row is not a failure but a loss: the eight digit hex had its own alpha, and it
was discarded. It is now multiplied by the opacity instead.

A box-shadow value is a comma separated list, and CSS treats a list as valid or invalid in one piece. One NaN anywhere in it removes every layer, with no error and nothing on the page to say why, which is exactly the failure a preview cannot show you. Colour is now read with a full CSS colour parser, an unreadable value is refused by name and that one layer is left out so the others survive, and every value arriving from a shared link is range checked the same way.

About the CSS Box Shadow Generator

Stack as many shadow layers as you like, in any colour notation, and watch the declaration build up. Anything the browser would refuse is caught here first, because a box-shadow list is valid or invalid as a whole: one bad layer takes all of them down, silently, and a preview that never renders it will not tell you.

Key features

  • Colour read with a full CSS colour parser: hex of three, six or eight digits, colour names, rgb(), hsl(), hwb(), lab(), oklch()
  • An eight digit hex keeps its own alpha, and the opacity slider multiplies it rather than replacing it
  • An invalid layer is named and excluded, so it cannot take the other layers down with it
  • Every value from a shared link range checked, so a URL cannot produce a declaration that will not parse
  • Twelve presets, each with a sentence explaining what it is doing
  • Preset thumbnails drawn by the same function that writes the output, so they cannot disagree
  • Layer reordering, a visibility toggle that keeps a layer without emitting it, and inset shadows
  • Live preview with an adjustable box colour and corner radius

How to use

  1. 1Set the horizontal and vertical offsets, the blur and the spread.
  2. 2Pick a colour in whatever notation you have to hand, and set the opacity.
  3. 3Add more layers, and use the move buttons to decide which paints on top.
  4. 4Watch the panel: an invalid layer is flagged and left out rather than breaking the whole declaration.
  5. 5Copy the CSS.

A box-shadow list is valid or invalid as a whole

The thing that decides whether a generated box-shadow works is not how it looks in a preview. It is whether the browser's parser accepts it, and a `box-shadow` value is a comma separated LIST, which CSS treats as valid or invalid in one piece. One bad component anywhere in it makes the browser throw away every layer, in silence, with nothing on the page to say why.

That used to be easy to trigger here. The colour was read with `parseInt(hex.slice(1, 3), 16)` and friends, which works for a six digit hex and produces nonsense for everything else. Measured against the browser's own parser on 2026-09-04, four of seven colour forms a person might reasonably type produced a declaration Chrome threw away: `#f00` became `rgba(240, 0, NaN, 0.5)`, `#FFF` became `rgba(255, 15, NaN, 0.5)`, `red` became `rgba(237, NaN, NaN, 0.5)`, and `rgb(255 0 0)` became `rgba(NaN, NaN, 85, 0.5)`. Each of those silently removed the shadow from the preview and from anything the CSS was pasted into. The shareable link was the same story: three of five URL values produced `NaNpx` or a NaN colour and the same silent disappearance.

Colour now goes through a full CSS colour parser, so three and six and eight digit hex, the 148 colour names, `rgb()`, `hsl()`, `hwb()`, `lab()`, `oklch()` and the rest all work. An eight digit hex keeps its own alpha and the opacity slider MULTIPLIES it rather than replacing it, so `#3b82f680` at 50 percent is 25 percent rather than silently becoming 50. Anything the parser cannot read is refused by name, the field is marked, and that ONE layer is left out of the declaration so the others survive: the panel says how many were excluded and why. Every value from the URL is range checked the same way, so a shared link cannot produce a declaration that will not parse.

The other thing worth knowing about this property is that the order of the layers is load bearing. CSS Backgrounds 3 paints the first shadow in the list on top of the ones after it, which is why the Layered preset stacks five shadows at doubling offset and blur, each at only 5 percent: a real shadow falls off smoothly and a single one cannot. The eye toggle takes a layer out of the output without deleting it, so a layer can be compared in and out, and every preset carries a sentence saying what it is doing and why.

One thing that was checked and found NOT to be a fault: the tool builds its declaration in one place and every preset thumbnail reads that same function, so the thumbnails and the code block cannot disagree. Twelve presets were put past the browser parser and all twelve were accepted, and each thumbnail's computed `box-shadow` was compared with the declaration the tool wrote and matched exactly.

Examples

  • Tight elevation shadow with negative spread

    Apply the Medium preset: two layers, 0 4px 6px -1px and 0 2px 4px -2px in black at 10 percent each. The negative spread keeps the shadow from bleeding sideways, giving a clean card lift.

  • Multi-layer neon glow

    Apply the Neon preset to stack three zero-offset green shadows at blur 10, 30 and 60px with opacity 80, 50 and 30 percent, producing a layered glow that a single shadow cannot replicate.

  • A colour that used to break it

    Type `red` or `#f00` into a layer's colour field. Both are read correctly now; before this pass either one produced a NaN component and the browser dropped every layer of the shadow.

Tips & best practices

  • Type a colour in any notation you like: `rebeccapurple`, `#f00`, `hsl(200 80% 50%)` and an eight digit hex with its own alpha all work, and anything unreadable is marked rather than silently breaking the shadow.
  • Use negative spread to tighten a shadow inside its blur so it does not bleed past the element's edges; the Medium and Large presets do this with spread -1 to -4.
  • For natural depth, stack three to five low-opacity layers with increasing offset and blur rather than one strong shadow. The Layered preset shows the shape of it.
  • Layer order matters: the topmost layer paints over the ones below, so use the move buttons to control which shadow wins where they overlap.
  • Toggle a layer's eye icon to compare with and without it, since only visible layers are written into the output.

Practical scenarios

  • Card elevation

    Stack three to five faint layers with growing offset and blur to get depth that reads as real rather than as a single grey blob.

  • Button hover states

    Build the resting and hovered shadows side by side and copy both, using the eye toggle to compare them without losing either.

  • Modal overlays

    A long, wide, low-opacity shadow lifts a dialog clear of the page; the Floating and Soft presets are the two shapes that usually work.

  • Debugging a shadow that disappeared

    Paste your colour into a layer. If the browser would refuse it, the panel says so by name instead of leaving you with an element that has no shadow and no error.

Frequently asked questions

Why did my shadow disappear when I changed the colour?

Almost certainly because the colour produced an invalid value and the browser dropped the whole declaration. A box-shadow list is valid or invalid in one piece, so one bad component removes every layer. This tool refuses the bad value by name instead, and keeps the rest of the list.

Can I stack multiple shadows?

Yes, and it is the main reason to use this. Real shadows fall off smoothly, which a single shadow cannot do; the Layered preset stacks five at 5 percent each to show what that looks like.

Which shadow paints on top?

The first one in the list. CSS Backgrounds 3 paints them front to back in the order written, so the move buttons decide which wins where two overlap.

What is an inset shadow?

One painted inside the border box rather than outside it, which reads as a recess or a pressed state. The Pressed preset combines a dark inset shadow at the top with a faint white one at the bottom, which is where light would fall on a dented surface.

Do box shadows affect layout?

No. They are painted outside the layout entirely, so they never change an element's size or push anything else around. They also do not respond to pointer events.

Can I use a colour with its own transparency?

Yes. An eight digit hex or an rgb() with an alpha keeps that alpha, and the opacity slider multiplies it, so `#3b82f680` at 50 percent comes out at 25 percent rather than silently losing the alpha it was given.

Related tools and how they differ

  • CSS Border Radius Generator: Rounds the four corners with px or % units; use it to shape an element's outline rather than cast a drop shadow under it.
  • CSS Button Generator: Builds a full button with hover states and transitions; use it when the shadow is part of a complete clickable button, not a standalone effect.
  • CSS Gradient Generator: Makes linear, radial, or conic color fills; use it for backgrounds, not for the soft shadow layers an element drops.
  • Glassmorphism Generator: Creates frosted-glass with backdrop-filter blur and translucency; use it when you want a see-through panel, not an opaque cast shadow.
  • CSS Animation Generator: Builds @keyframes with timing and easing; use it to animate a glow or shadow over time instead of setting one static box-shadow.
  • CSS Clip Path Generator: Crops an element to a polygon shape; use it to change silhouette, not to add depth beneath a rectangular box.

Further reading

  • CSS Box Shadows: From Subtle Depth to Dramatic Effects12 min read

Private by design

This runs as client-side JavaScript. Keys, tokens, payloads, and other inputs never leave your device.