About Box Shadow Generator
The CSS box-shadow property adds depth to cards, buttons and images. It takes a horizontal offset, a vertical offset, a blur radius, a spread radius and a colour, and can be set to inset to draw the shadow inside the element.
Enter the four numbers followed by a colour, and the tool writes a clean declaration with pixel units. Leave out any value and a default is used. Add the word inset to create an inner shadow. A soft shadow with a low-opacity colour usually looks better than a hard dark one.
How to use Box Shadow Generator
- Enter offset-x, offset-y, blur and spread, then a colour such as rgba(2,30,64,0.15).
- Click Run Tool to get the declaration.
- Copy it into your CSS and adjust the numbers until it looks right.
Example
Input
0 14 40 0 rgba(2,30,64,0.15)
Output
box-shadow: 0 14px 40px 0 rgba(2,30,64,0.15);
Common uses
- Adding a soft elevation to cards and buttons.
- Creating an inner shadow for an input field.
- Standardising shadow values across a design system.
Privacy and safety
This tool runs in your browser. The text you enter is processed on your device and is not sent to NHP Learning.
Frequently asked questions
What do the four numbers mean?
In order: horizontal offset, vertical offset, blur radius and spread radius. Positive offsets move the shadow right and down.
How do I make a subtle shadow?
Use a larger blur, no spread and a colour with low opacity, for example 0 14px 40px 0 rgba(2, 30, 64, 0.15).
Can I add several shadows?
CSS allows a comma-separated list of shadows. Generate each one here and join them with commas in your stylesheet.