CSS Box Shadow Generator
Create custom CSS box shadows with real-time visual preview. Generate subtle to dramatic shadow effects for cards, buttons, and UI elements.
How the CSS Box Shadow Generator works
Build a CSS box-shadow by setting offsets, blur, spread, color, opacity and inset, with an optional stack of layered shadows. A preview box updates as you change values, and the CSS can be copied or downloaded.
- Optionally start from a Quick Presets button: Subtle, Medium, Large, Colored, Inset or Multiple.
- Set Horizontal Offset, Vertical Offset, Blur Radius and Spread Radius in whole pixels.
- Choose Shadow Color with the picker or a 3- or 6-digit hex code, and set Opacity from 0 to 1.
- Turn on Inset Shadow for an inner shadow, or Multiple Shadows to stack 2 to 5 layers chosen in Number of Shadows.
- Watch the Preview box, then click Copy CSS or Download (box-shadow.css). Reset restores the defaults.
What each value does
The output follows the CSS syntax box-shadow: x-offset y-offset blur spread color, with inset added at the end when enabled. The defaults produce box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.1);
A positive horizontal offset moves the shadow right and a positive vertical offset moves it down. Blur softens the edge and cannot be negative, so a negative blur is set to 0 when you leave the field. Spread grows (positive) or shrinks (negative) the shadow before blurring. The color and opacity are combined into one rgba() value.
How Multiple Shadows are built
Each extra layer is derived from your settings. Layer 1 uses them as set; each following layer adds 2px to both offsets and the blur, adds 1px to the spread, and lowers the opacity by 0.05, never going below 0.05 and never above layer 1's opacity (so with an opacity under 0.05 every layer uses that opacity). Shadows listed first are painted on top.
The Multiple preset (3 layers, opacity 0.15) outputs: box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.15), 2px 6px 10px 1px rgba(0, 0, 0, 0.1), 4px 8px 12px 2px rgba(0, 0, 0, 0.05);
Presets and input notes
Subtle: 0 2px 4px, black at 0.1. Medium: 0 4px 8px, black at 0.15. Large: 0 8px 16px, black at 0.2. Colored: 0 4px 8px, #3B82F6 at 0.3. Inset: 0 2px 4px, black at 0.1, inset. Multiple: Medium's values with 3 layers. All presets set spread to 0. Presets other than Multiple do not switch Multiple Shadows off.
Pixel fields take whole numbers, including negative offsets and spread; the preview updates as you type, and a decimal is rounded and an empty or invalid entry restored when you leave the field. The arrow keys step by 1 (0.01 for opacity). Opacity is kept between 0 and 1 and rounded to two decimals in the CSS. If the hex field holds an invalid code, a message appears and the shadow keeps the last valid color. Everything runs in your browser.
Frequently asked questions
What is the difference between blur radius and spread radius?
Blur controls how soft the shadow's edge is: 0 gives a hard edge, and larger values fade it out over more pixels. Spread changes the shadow's size before the blur is applied, so a positive spread makes the shadow larger than the element.
How do I make an inner shadow?
Turn on Inset Shadow, or click the Inset preset. The tool adds the inset keyword so the shadow is drawn inside the element's border, which suits pressed buttons and input fields.
Can an element have more than one box shadow?
Yes. CSS accepts a comma-separated list, and the first shadow in the list is drawn on top. Multiple Shadows generates such a list with 2 to 5 progressively larger, lighter layers.
Does box-shadow take up space in the layout?
No. Shadows do not affect an element's size or push neighboring elements. They can be clipped if a parent element has overflow: hidden.
Do I still need -webkit-box-shadow?
No. Unprefixed box-shadow has worked in all major browsers for over a decade, so the generated CSS omits prefixes.
What is the difference between box-shadow and drop-shadow?
box-shadow follows the element's rectangular box and rounded corners. The filter: drop-shadow() function follows the visible shape, including transparent areas of images, but it has no spread value and no inset option.
Similar Developer tools
Hex to RGB Converter
Convert hexadecimal color codes to RGB color values effortlessly with our Hex to RGB Converter. Perfect for web and graphic designers.
Markdown Previewer
Preview your Markdown content in real-time with our Markdown Previewer. Perfect for documentation, notes, and blog posts.
Base64 Encoder/Decoder
Encode and decode UTF-8 text as standard Base64. Supports Unicode; this is encoding, not encryption.