Box Shadow Generator
Design CSS box shadows visually and copy the code.
Tune offset, blur, spread, color and opacity of a box-shadow and copy the finished CSS.
Loading the interactive tool… This page needs JavaScript to run the Box Shadow Generator.
How to use Box Shadow Generator
- Choose your colors or values.
- Preview the result live.
- Tweak until it looks right.
- Copy the CSS or code into your project.
How Box Shadow Generator works
Sliders control the horizontal and vertical offset, blur radius, spread and opacity, and a color picker sets the shadow color, which is converted to an rgba value. You can switch between an outer shadow and an inset one. The tool writes a single box-shadow declaration and previews it live; it does not stack multiple shadow layers.
Worked example
Input x 0, y 4, blur 12, spread 0, opacity 20%, color #000000, outer → Output box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.20); a soft shadow just below the element.
Common uses
- Giving cards and buttons a subtle elevation that matches a design mockup.
- Creating an inset shadow for pressed buttons or input fields.
- Tuning blur and spread by eye, then pasting the exact CSS into a stylesheet.
Best for
- cards and buttons
- depth in UI design
- neumorphism experiments
Tips for better results
- Keep shadow opacity low for a natural look.
- Check color contrast for accessibility.
- Test designs on light and dark backgrounds.
- Keep a copy of final values in your design system.
Frequently asked questions
What does blur radius do?
A larger blur makes the shadow softer and more spread out.
Can I make an inset shadow?
Yes, toggle the inset option to place the shadow inside the box.
Is my data sent to a server?
No. This tool runs in your browser, so what you enter stays on your device.
Related tools
- CSS Text Shadow Generator — Build CSS text shadows with a live preview.
- CSS Border Radius Generator — Design rounded corners per corner and copy the CSS.
- CSS Clamp Generator — Create fluid font sizes with the CSS clamp() function.
- CSS Gradient Generator — Create linear and radial CSS gradients with ready-to-copy code.
- Glassmorphism CSS Generator — Create frosted-glass CSS with blur, transparency and border.
- Color Palette Generator — Generate harmonious color palettes from a base color.