Developer tools
Single CSS box shadow
Generate one CSS box-shadow, outer or inset, with offsets, blur, spread and a hex colour with separate alpha, and copy the resulting CSS code.
The example values can be changed. Press Calculate to update the result; you can download it as TXT or CSV and collect scenarios in this tab. Nothing is saved or sent automatically.
Result
Method:
Creates one shadow, outside the box or inset. For several layered shadows, combine the generated values with commas yourself. Colour is a hex value with a separate alpha from 0 to 1, so #000000 with alpha 0.25 becomes rgba(0, 0, 0, 0.25). The preview depends on your browser, so check the result on your own page. Copy the code or download it as TXT or CSV; JSON and printable HTML files also keep your inputs. Nothing is saved or sent automatically and entered addresses are never opened.
Decimal results are approximate. Inputs stay in this browser tab.
How it works
Your values are checked against the allowed ranges and written as a single CSS rule. Creates one shadow, outside the box or inset. For several layered shadows, combine the generated values with commas yourself. Colour is a hex value with a separate alpha from 0 to 1, so #000000 with alpha 0.25 becomes rgba(0, 0, 0, 0.25). The preview depends on your browser, so check the result on your own page. Copy the code or download it as TXT or CSV; JSON and printable HTML files also keep your inputs. Nothing is saved or sent automatically and entered addresses are never opened.
Worked example
With these example values the calculator gives the result below. You can change any value in the form above.
Inputs
- Horizontal offset: ±100px
- 4
- Vertical offset: ±100px
- 8
- Blur: 0–100px
- 12
- Spread: ±100px
- 0
- Opaque hex colour
- #2979FF
- Alpha: 0–1
- 0.5
- Position
- Outer
Result
- CSS box shadow
- box-shadow: 4px 8px 12px 0px rgba(41, 121, 255, 0.5);
Frequently asked questions
How do I create a CSS box shadow?
Set the horizontal and vertical offset, blur, spread, colour, alpha and position, then generate. With x 4, y 8, blur 12, spread 0, colour #2979FF and alpha 0.5 the result is box-shadow: 4px 8px 12px 0px rgba(41, 121, 255, 0.5);
What values can I use for the box shadow offsets and blur?
Offsets and spread range from −100 px to 100 px, and blur from 0 to 100 px. The colour is an opaque hex base with a separate alpha value.
Can the box shadow generator make an inset shadow?
Yes. You can choose an outer or an inset shadow, but only one shadow; multiple layers are not supported.
What class name can I use for the generated box shadow CSS?
The class name must be 1 to 64 ASCII characters, starting with a letter or underscore, followed by letters, digits, underscores or hyphens. Add the class to the element you want to style.
Will the box shadow look the same in every browser?
Not necessarily. The CSS values are exact, but browser rendering and layout can differ, and the preview gives no contrast or device guarantee.
How can I save the generated box shadow code?
Download the generated CSS code file, an exact JSON file or a printable HTML result. The code is never executed, and nothing is saved or sent automatically.