What is css box shadow generator?
A box shadow adds depth to cards, buttons, menus and images. Soft, low opacity shadows look natural, while hard dark ones look heavy.
This generator shows the result live and writes the CSS for you, including a proper rgba color so you can control opacity.
How to use the css box shadow generator
- Move the values until the preview looks right.
- Pick the shadow color and opacity.
- Copy the CSS line.
How the css box shadow generator works
The shadow is written as offset x, offset y, blur, spread and a color. The hex color and opacity are converted to an rgba value. The inset option places the shadow inside the box.
Worked example
Common uses of the css box shadow generator
- Card and panel design.
- Button hover effects.
- Modal and menu depth.
- Image frames.
- Learning how shadows work.
Tips and common mistakes
Use a larger blur and lower opacity for a soft look.
Match the shadow direction across your whole design.
Background: what to know before you rely on it
Shadows tell the eye which elements sit above others. Material and many modern design systems use layered shadows, a tight dark one for contact and a wide soft one for height. This generator makes one layer, and you can combine several by hand. Large blurs on many elements can slow rendering on weak devices, so use them with care on long lists. Keep opacity low and color slightly tinted toward your background for the most natural result.
Private, free and fast
This tool runs entirely in your browser. What you type or choose is not uploaded to a server and is not saved after you close the page, which keeps it fast and private. It is free to use as often as you like. See more in all developer tools, or browse the full list of tools.
Frequently asked questions
What does spread do?
It grows or shrinks the shadow before blur is applied.
What is an inset shadow?
A shadow drawn inside the box, often used for pressed buttons.
Can I stack shadows?
Yes, separate several shadows with commas in the CSS.
Does it work on text?
No. Use the text shadow property for text.
Related tools
CSS Gradient Generator
Choose two colors, a gradient type and an angle. The tool shows a live preview and gives you the CSS...
GeneratorsColor Palette Generator
Pick a base color and a scheme to get a matching palette with HEX codes and CSS variables. Schemes...
Developer ToolsCSS Minifier
Paste your CSS and the minifier removes comments and extra whitespace to make the file smaller, with the...
ConvertersColor Converter
Enter a HEX color code to see the matching RGB and HSL values, a live swatch and the contrast ratio...
Developer ToolsJSON Formatter and Validator
Paste your JSON and the tool checks that it is valid, then formats it with indentation or compresses it...
Developer ToolsBase64 Encoder and Decoder
Base64 turns text or bytes into a safe string of letters and numbers. Choose encode or decode, paste...
Results are for information and education. For legal, financial, medical or security decisions, check with a qualified professional. Do not paste live secrets into any website.