QREndless

CSS Box Shadow Generator

Layered CSS shadows with a live preview card.

100% on-device
X Offset0px
-1000100
Y Offset10px
-1000100
Blur Radius25px
0 (sharp)100 (soft)
Spread Radius-5px
-50 (shrink)050 (grow)
#000000
Opacity15%
0% (transparent)100% (opaque)
Live Preview
CSS Outputread-only
box-shadow: 0px 10px 25px -5px rgba(0, 0, 0, 0.15);
Free online CSS box shadow generator with live preview and adjustable offset, blur, spread, and color

The Best CSS Box Shadow Generator

Live Preview

Every slider drag updates the preview box in real time — see exactly how your shadow looks before copying the CSS. No build step, no guesswork.

Pixel-Perfect CSS

Outputs a clean, copy-ready `box-shadow:` declaration. Spread and blur are in `px`; the color is emitted as `rgba(r, g, b, a)` with the alpha baked in. One click to copy.

8 Curated Presets

Hand-picked professional shadows — subtle drop, soft float, sharp edge, big float, long drop, inset border, emerald glow, amber glow. Pick one at random with `crypto.getRandomValues`.

100% Private

All math runs in your browser. No CSS is uploaded, logged, or sent to any server. No signup, no daily limit, works offline once loaded.

How to Use It in 3 Steps

  1. See a Live Preview

    A sample card renders your shadow in real time — drag any slider and the preview updates instantly, dark mode included.

  2. Tune Values or Grab a Preset

    Adjust x/y offset, blur, spread, opacity, and color — or hit Random Preset for one of 8 curated production-ready shadows (subtle drop, soft float, glow, inset…).

  3. Copy the CSS

    One click copies the exact box-shadow declaration — inset flag, px values, and rgba color — ready to paste into your stylesheet or Tailwind arbitrary value.

CSS Box Shadow Generator for Every Need

Cards & UI Panels

Give cards, modals, and dropdowns believable elevation — a 0 10px 25px -5px style float reads as “lifted” without shouting.

Glows & Neumorphism

Colored glows (emerald, amber) and 0-offset inset shadows build soft-UI effects: focus rings, active states, and extruded surfaces.

Heroes & CTA Sections

Lift the primary button and hero card off the background with a long, low-opacity drop — the fastest way to direct the eye to the action.

Dark Mode Design

Shadows barely show on dark backgrounds — experiment with higher opacity or colored glows and copy values that work on both themes.

Performance-Conscious UI

Compare blur radii before committing: huge blurs on hundreds of elements cost real paint time, so find the smallest value that still reads well.

Design System Tokens

Generate the three canonical elevations (sm/md/lg) once, paste them as CSS variables, and every component stays visually consistent.

Complete Guide

Box Shadow Generator: The Complete A-to-Z Guide

Every box-shadow value explained — offset, blur, spread, color, opacity, inset — plus elevation recipes, dark-mode tricks, and performance notes.

What Is a CSS Box-Shadow?

The box-shadow property paints one or more shadows around an element’s border box. It is the CSS workhorse for elevation — the visual cue that a card floats above the page, a modal sits above the app, or a button is pressable. Because it is pure CSS (no images, no gradients-on-edges hacks), it scales crisply on every display and animates cheaply with a transition.

A declaration looks like box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15); — five values: x-offset, y-offset, blur radius, spread, and color. Order matters: x before y, blur before spread, and blur can only be zero or positive while spread can go negative.

The Five Values, One by One

  • x-offset — horizontal shift. Positive moves the shadow right, negative left. 0 keeps it centered under the element.
  • y-offset — vertical shift. Positive moves it down. The single most expressive value: 4px reads as “hovering”, 20px as “floating”.
  • blur radius — how soft the edge is. 0 gives a hard, poster-like edge; 25+ gives a diffuse cloud. The shadow extends this far beyond the offset edge.
  • spread — grows (+) or shrinks (−) the shadow before blur is applied. Negative spread is the pro trick that keeps big-blur shadows tight to the element instead of bleeding everywhere.
  • color + opacity — almost always black at low opacity (8–25%). Low opacity is what separates “designed” shadows from “drop shadow” clip-art.

Offset vs Blur vs Spread: The Mental Model

Think of the shadow as a copy of the element’s silhouette. Offset moves that copy. Blur smears its edges outward in every direction. Spread scales the copy before smearing. A hard-edge offset shadow (4px 4px, blur 0) gives the retro “sticker” look; a zero-offset, high-blur, negative-spread shadow gives the modern “soft float”; a zero-offset, zero-blur, positive-spread gives a solid ring (useful for inset effects). When a shadow looks wrong, ask which of the three dials is off — it is usually too much spread with too little blur.

Opacity: Why rgba Beats Solid Colors

A solid #000 shadow at 100% looks like a hole punched in the page. Real-world shadows are faint — ambient light diffuses them — which is why production UI lives in the 8–30% opacity range. Using rgba(0,0,0,alpha) instead of a pre-darkened gray also means the shadow blends with whatever is underneath: over white it reads light, over a tinted background it picks up that tint automatically. The opacity slider here drives exactly that alpha channel.

Inset Shadows and Neumorphism

The inset keyword flips the shadow from outside the element to inside it — the classic uses are pressed-in input fields and progress-bar tracks. Push the idea further and you get neumorphism: a light inset from the top-left plus a dark drop to the bottom-right (or vice versa) makes a surface look extruded out of, or carved into, the background. Two warnings: neumorphism fails contrast checks for text, and inset shadows need low offsets to avoid banding on large elements.

Material-Style Elevation Recipes That Work

Google’s Material Design popularized a numbered elevation ladder, and the values behind it are worth stealing. Three of the presets in this tool map directly:

  • Resting card (elevation 1–2): 0 4px 6px -1px rgba(0,0,0,0.1) — barely there, separates lists from background.
  • Floating card (elevation 3–4): 0 10px 25px -5px rgba(0,0,0,0.15) — the default here; the workhorse for modals and hover states.
  • Dialog / FAB (elevation 6+): 0 20px 50px -10px rgba(0,0,0,0.25) — unmistakably “above everything”.

Use the ladder consistently: the bigger the blur, the fewer the elements that earn it.

Shadows and Performance

Large blur radii are one of the more expensive paint operations in CSS — a 100px blur on hundreds of list items shows up in scroll profiling. Mitigations: prefer one well-tuned shadow over three stacked layers, keep blur under ~50px for repeated elements, and animate transform + opacity instead of transitioning the box-shadow itself when you need 60fps hover effects. (Transitioning between two shadows is fine for a single card; it is the 200-card list that hurts.)

Step-by-Step: Using the Box Shadow Generator

  1. Start from a preset. Hit Random Preset until you land near the vibe — subtle drop, soft float, sharp edge, long drop, inset, or a colored glow.
  2. Adjust the offsets. Keep x at 0 for neutral UI light; add y for lift.
  3. Balance blur and spread. Bigger blur usually wants negative spread to stay contained.
  4. Set color and opacity. Black at 10–25% for realism; a brand hue at higher opacity for glows.
  5. Check the preview on the sample card, then toggle inset if you want the inner-shadow variant.
  6. Copy the CSS and paste it in — or store it as a design-system variable.

Ready to Create Your Box Shadow?

You know what each of the five values does, why low-opacity rgba wins, how inset enables soft-UI effects, and which elevation recipe fits a card versus a dialog. Scroll back up, drag the sliders, and copy a production-ready box-shadow in seconds.

Jump back to the box shadow generator above ↑

Frequently Asked Questions

Everything you need to know about css box shadow generator.
What is a CSS box-shadow?

A `box-shadow` declaration adds one or more drop shadows to an element. The full syntax is `box-shadow: <inset?> <x-offset> <y-offset> <blur-radius> <spread-radius> <color>;`. The X and Y offsets move the shadow, blur softens its edges, spread expands (positive) or contracts (negative) its size, and `inset` turns it into an inner shadow.

How do I make an inset (inner) shadow?

Tick the "Inset" checkbox. The CSS output will prefix the value with the `inset` keyword, e.g. `box-shadow: inset 0 0 0 2px rgba(0,0,0,0.20);`. Inset shadows render inside the element's border, useful for depressed / neumorphic looks.

What's the difference between blur radius and spread radius?

Blur radius (`blur`) controls how soft the shadow's edges are — 0 means a sharp copy of the element's shape, larger values produce a softer, more diffused shadow. Spread radius (`spread`) grows (positive) or shrinks (negative) the shadow's overall size by that many pixels in every direction. A negative spread with a large blur produces the popular "floating card" look.

How is the alpha opacity applied to the color?

The opacity slider (0-100%) is converted to a decimal alpha and emitted as part of an `rgba(r, g, b, a)` color. For example, opacity 25% on `#000000` becomes `rgba(0, 0, 0, 0.25)`. This keeps the CSS self-contained — no separate `opacity` or `color` overrides needed.

Can I layer multiple box-shadows?

This tool generates one shadow at a time so the controls stay simple. To combine multiple shadows in your final CSS, separate each with a comma, e.g. `box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 10px 25px rgba(0,0,0,0.15);`. You can generate each layer here, copy it, and join them by hand in your stylesheet.

Is this tool free and private?

Yes. The Box Shadow Generator is 100% browser-based, free forever, and requires no signup. Your settings and the generated CSS never leave your device — there are no server calls of any kind.

Ready to use the CSS Box Shadow Generator?

Open the tool