Developer Tools

Box Shadow Generator

Live

Calculate css declaration from horizontal offset, vertical offset, blur radius, spread radius.

About Box Shadow Generator

Calculate css declaration from horizontal offset, vertical offset, blur radius, spread radius. Enter horizontal offset, vertical offset, blur radius, spread radius, shadow color, inset shadow in a purpose-built box shadow generator interface designed for this subject. Offsets, blur, spread, color, and inset mode are serialized into a valid box-shadow declaration. The result includes css declaration, shadow value, preview style, supporting detail, and clear units or diagnostics. Results depend on the entered assumptions, units, supported input range, and rounding. Review important decisions against authoritative requirements. Processing stays in your browser, and UtilityPages does not store the values you enter.

Set up Box Shadow Generator

Workspace

Source workbench

Edit the source fields below and inspect the rendered output alongside your work.

This workspace updates as you edit.

Enter horizontal offset.

Enter vertical offset.

Enter blur radius.

Enter spread radius.

Enter shadow color.

Enter inset shadow.

Box Shadow Generator result

Enter the values above, then process to see a detailed result.

How Box Shadow Generator works

Offsets, blur, spread, color, and inset mode are serialized into a valid box-shadow declaration.

How it works

Offsets, blur, spread, color, and inset mode are serialized into a valid box-shadow declaration. Results depend on the entered assumptions, units, supported input range, and rounding. Review important decisions against authoritative requirements.

Examples

Box Shadow Generator worked example

Example input
{
    "offset_x": 0,
    "offset_y": 12,
    "blur": 30,
    "spread": -8,
    "color": "rgba(15, 23, 42, .28)",
    "inset": "no"
}
Expected result
{
    "css": "box-shadow: 0px 12px 30px -8px rgba(15, 23, 42, .28);",
    "shadow_value": "0px 12px 30px -8px rgba(15, 23, 42, .28)",
    "preview_style": "box-shadow:0px 12px 30px -8px rgba(15, 23, 42, .28)"
}

Privacy

This tool does not store your inputs or results on UtilityPages.org.

Citations & sources

  1. Web APIs

Frequently asked questions

How does the Box Shadow Generator work?

Offsets, blur, spread, color, and inset mode are serialized into a valid box-shadow declaration.

What information should I enter?

Enter horizontal offset, vertical offset, blur radius, spread radius, shadow color, inset shadow. Use values and units from the same scenario so the result is internally consistent.

What results does this tool provide?

It reports css declaration, shadow value, preview style, including intermediate context where it helps you review the answer.

What limitations should I know about?

Results depend on the entered assumptions, units, supported input range, and rounding. Review important decisions against authoritative requirements.