Generate a complete, mathematically consistent shadow elevation system for your design system. Control blur, spread, opacity, and offset growth curves then export CSS variables and a Tailwind config extension ready to paste into your project.
Generate 3 to 10 elevation levels with mathematically growing blur, spread, opacity, and offset values
See every elevation level rendered as a real UI card on light and dark backgrounds as you adjust each parameter
One-click copy for CSS custom properties with utility classes, and a complete Tailwind boxShadow config extension
Start with a preset (Material Design, Soft UI, Sharp Depth, Glow), then fine-tune blur growth, spread, opacity, and offset curves. Every parameter change updates the preview and code output in real time.
Start with a preset:
Blur
How fast blur increases per level
Spread
Opacity
Offset
Level 1
Level 2
Level 3
Level 4
Level 5
Level 6
| Level | Blur | Spread | Opacity | Offset Y | Preview |
|---|---|---|---|---|---|
| L1 | 2px | 0px | 14% | 1px | |
| L2 | 6px | 0px | 15% | 3px | |
| L3 | 14px | 0px | 16% | 5px | |
| L4 | 26px | 0px | 16% | 7px | |
| L5 | 42px | 0px | 17% | 9px | |
| L6 | 62px | 0px | 18% | 11px |
When to use each level
CSS Custom Properties + Utility Classes
:root {
--shadow-1: 0px 1px 2px 0px #00000024;
--shadow-2: 1px 3px 6px 0px #00000026;
--shadow-3: 2px 5px 14px 0px #00000028, 1px 2px 6px 0px #00000010;
--shadow-4: 3px 7px 26px 0px #0000002a, 1px 2px 10px 0px #00000011;
--shadow-5: 4px 9px 42px 0px #0000002c, 1px 3px 17px 0px #00000012;
--shadow-6: 5px 11px 62px 0px #0000002e, 2px 3px 25px 0px #00000012;
}
/* Utility classes */
.shadow-elevation-1 { box-shadow: var(--shadow-1); }
.shadow-elevation-2 { box-shadow: var(--shadow-2); }
.shadow-elevation-3 { box-shadow: var(--shadow-3); }
.shadow-elevation-4 { box-shadow: var(--shadow-4); }
.shadow-elevation-5 { box-shadow: var(--shadow-5); }
.shadow-elevation-6 { box-shadow: var(--shadow-6); }No account required — 100% free
Most codebases handle shadows the same way they handle border radii: one engineer copies a box-shadow value from Stack Overflow, another finds something that "looks right" in the inspector, and a third picks something from a design tool. Six months later, the product has eleven different shadow values across forty components, none of them related, none of them consistent. This tool generates a mathematically coherent shadow system in two minutes so you ship depth, not chaos.
Elevation is the visual metaphor that places UI components at different heights above the surface they sit on. A card at elevation 2 sits slightly above the page surface. A dropdown at elevation 4 sits noticeably above both the card and the page. A modal at elevation 8 sits highest of all far above everything else. This vertical hierarchy communicates interaction priority: the higher the elevation, the more the element demands attention.
Shadows are the primary visual cue for elevation. As an element rises, its shadow grows larger (more blur), spreads wider, and grows slightly more transparent because real light sources cast softer, more diffuse shadows on objects that are farther away. The most realistic shadow systems use two shadow layers per elevation level: a key shadow (directional, tight, higher opacity) and an ambient shadow (undirected, soft, lower opacity), mirroring the behavior of real-world lighting with a dominant light source and diffuse ambient light.
Google's Material Design popularized the layered shadow model with explicit elevation levels (0–24dp) mapped to specific shadow values. Each level uses two shadows: a key shadow (y-offset dominant) and an ambient shadow (soft, low opacity). This creates the most physically accurate depth illusion.
Soft UI uses offset colored shadows (often matching the background tint) to create an extruded appearance. Instead of simulating overhead lighting, it simulates light from a fixed diagonal direction, creating a raised button or pressed inset effect.
Many modern SaaS products use minimal shadows — a single-pixel border with a very light drop shadow at level 1, growing to a modest diffuse shadow at level 3 for modals. This approach prioritizes color contrast over shadow depth for visual hierarchy.
Increasingly popular in dark-mode-first products, colored glows replace neutral shadows. A blue primary button casts a blue glow. A green success state glows green. The effect reinforces semantic color meaning while adding dimensionality.
Inconsistent shadows are invisible to most users they can't articulate what feels wrong. But they feel it. When a tooltip has a tighter, darker shadow than the modal it sits inside, the depth hierarchy inverts: the tooltip appears to sit lower than the modal, which contradicts its stacking order. Users resolve this cognitive dissonance by trusting the interface less, even without knowing why.
For engineers and designers, inconsistent shadows create maintenance debt. When shadows aren't tokenized, every new component becomes a judgment call. Shadow values spread across dozens of files, and any rebrand or theme change requires a full audit and manual update of every instance. A token-based shadow system reduces that to a single file change.
The generator uses parametric curves to grow each shadow property as elevation increases, rather than requiring you to specify every level manually. Here's what each parameter controls:
Paste the CSS output into your global stylesheet. Reference elevation variables anywhere in your CSS:
.card { box-shadow: var(--shadow-2); }
.dropdown { box-shadow: var(--shadow-4); }
.modal { box-shadow: var(--shadow-7); }
/* Or use the generated utility classes directly */
<div class="shadow-elevation-3">...</div>Merge the Tailwind output into your config. Your shadow tokens become utility class names:
{/* Semantic elevation via named Tailwind classes */}
<div className="shadow-elevation-2">Card</div>
<div className="shadow-elevation-4">Dropdown</div>
<div className="shadow-elevation-7">Modal backdrop</div>On dark backgrounds, shadows with high opacity become invisible (dark on dark). Override your shadow tokens for dark mode to use lighter or higher-opacity values:
[data-theme="dark"] {
/* Reduce opacity — shadows need less contrast on dark surfaces */
--shadow-1: 0px 1px 3px 0px #ffffff14;
--shadow-4: 0px 4px 16px 0px #ffffff20;
/* Or use color-mix() in modern CSS */
}One critical implementation detail: shadows interact with background colors. A pure black shadow (#000000) at 15% opacity is nearly invisible on a dark background. On white, it's a strong shadow. On colored surfaces, it creates a muddy tint. Always preview your shadow scale on the actual background color your components will use which is exactly why this tool includes a dark/light background toggle.
If your card uses level 2 and your modal uses level 8, components that logically sit between them (dropdowns, tooltips, popovers) must use levels 4–6. Skipping creates visual gaps in your depth hierarchy that users perceive as inconsistency.
10-level shadow systems are rarely necessary. Most products need: none (flat), subtle (cards), raised (dropdowns), elevated (dialogs), overlay (modals). Five levels cover 95% of real use cases. More levels add complexity without meaningful visual differentiation.
Neutral shadows (#000000) are the safe default. Tinted shadows (brand-colored, or darkened from the surface color) create more polished results because they don't appear as pure gray blobs. A blue-tinted shadow on a white surface looks intentional; pure black looks like a default.
box-shadow renders on the CPU in older browsers and forces repaints on scroll. For performance-critical UIs (long virtualized lists, infinite scroll), consider using filter: drop-shadow() instead of box-shadow, or pre-rendering shadows as pseudo-element backgrounds that don't trigger repaint.
Most products need 4–6 semantic levels: 0 (flat/no shadow), 1–2 (subtle lift for cards and list items), 3–4 (raised for dropdowns and tooltips), 5–6 (elevated for dialogs and sheet components), and 7+ (overlay for modals and full-screen panels). Ten-level systems make sense for component libraries that need to accommodate many different product contexts, but a standalone product rarely uses more than 6 meaningfully distinct elevations. Fewer levels, used consistently, create more visual coherence than many levels used arbitrarily.
box-shadow applies to the element's border box regardless of its shape a rounded card gets a shadow on its rectangle, not its visible shape. filter: drop-shadow() follows the element's actual rendered alpha channel, including transparent gaps in a PNG icon or the exact curves of an SVG. Use box-shadow for rectangular components (cards, buttons, inputs). Use drop-shadow() for icons, SVGs, images with transparency, and components where the shadow should follow the visible shape. Importantly, box-shadow supports the spread parameter while drop-shadow() does not.
Dark surfaces absorb shadows a pure black shadow on a dark gray surface is nearly invisible. Dark mode shadow systems typically use one of three approaches: (1) Increase shadow opacity for dark surfaces (going from 14% to 30–40%), (2) Add a subtle lighter-than-surface overlay color to elevate components instead of shadows (Material Design 3's approach), or (3) Use colored glows that contrast against the dark background. The most maintainable approach is to define your shadow scale as CSS custom properties and override the values in a dark-mode selector, giving you independent control over light and dark shadow systems.
Multi-layer shadows (two or more box-shadow values per level) produce significantly more realistic depth than single-layer shadows. The industry standard is two layers: a key shadow that simulates the dominant directional light source (typically above and slightly in front of the user), and an ambient shadow that simulates diffuse light from all directions. Material Design's elevation system uses this approach. The main trade-off is CSS complexity each shadow becomes a comma-separated list rather than a single value. This tool's 'layered shadows' toggle lets you compare both approaches.
box-shadow is a CSS painting property that triggers repaint when animated or changed on scroll. It renders on the GPU in modern browsers, but complex shadows (especially blurred, large-spread values) increase paint time. For performant shadow animations (hover effects, scroll-responsive elevation), use the will-change: box-shadow property to pre-promote the element to its own compositor layer. For virtualized lists with many elevated cards, benchmark your repaint budget with Chrome DevTools before shipping a high-blur shadow system large blur radii on many elements simultaneously can drop frame rates below 60fps on lower-powered devices.
A consistent shadow system takes less than five minutes to build with the right tool, and it pays dividends every time a new component is designed or a theme needs updating. Generate your elevation scale above, paste the output into your project, and eliminate shadow inconsistency permanently.
Free forever · No account · CSS & Tailwind output
Every tool runs entirely in your browser no uploads, no servers, no accounts. Fast, private, and free forever.
Colors, typography, CSS, SVG & more
Generate beautiful color schemes using color theory algorithms monochromatic, complementary, triadic, and more.
Build stunning CSS gradients visually linear, radial, and conic and copy production-ready code instantly.
Discover expert Google Fonts combinations curated for optimal readability and aesthetic harmony.
Generate production CSS visually flexbox, grid, typography, border, and box shadow with live preview.
Upload, edit, optimize, and convert SVG files entirely in your browser. Export clean SVG or React JSX.
Images, accessibility, spacing & readability
Compress images up to 90% smaller WebP, AVIF, JPEG, PNG with filters, cropping, and rotation. 100% private.
Remove image backgrounds instantly using on-device AI no uploads, no account. Download transparent PNG.
Generate a mathematically consistent shadow elevation system and export CSS variables or Tailwind config.
Build a harmonious spacing scale based on mathematical ratios and export it as CSS or Tailwind config.
Preview and compare border radius values in real time across multiple shapes and sizes.
URLs, QR codes, tracking & security
Shorten any URL instantly with browser history, QR code export, and zero server tracking.
Custom QR codes for URLs, WiFi, vCards & more. Add colors, logo, download PNG or SVG.
Build GA4-ready UTM tracking URLs with smart presets, validation, and CSV history export.
Strip 50+ tracking parameters (UTM, fbclid, gclid, msclkid) with before/after comparison.
See how your URL appears on Twitter, Facebook, LinkedIn & WhatsApp. Check OG metadata.