CSS Box Shadow Generator

Build a box-shadow with live preview and copy the CSS.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

CSS box-shadow generator

This tool builds a CSS box-shadow visually and gives you the exact value to paste into your stylesheet. It is for developers styling buttons, cards, modals and inputs who want a precise shadow without trial-and-error. The live preview shows the shadow on a sample box as you adjust each control.

How it works

The box-shadow property follows the order [inset] offset-x offset-y blur-radius spread-radius colour. The generator reads your sliders and assembles that string: offset X and Y position the shadow, blur softens its edge, and spread expands (positive) or contracts (negative) it. Your hex colour and opacity slider are combined into an rgba() value so the shadow can be semi-transparent, and ticking inset prepends the inset keyword to draw the shadow inside the element.

Example

With offset X = 0px, offset Y = 8px, blur = 24px, spread = -4px, colour #0f172a and opacity 25%, the tool outputs:

box-shadow: 0px 8px 24px -4px rgba(15, 23, 42, 0.25);

That is a soft, downward elevation shadow typical of cards. Tick inset and it becomes inset 0px 8px 24px -4px rgba(15, 23, 42, 0.25), an inner shadow instead.

EffectOffset YBlurSpread
Subtle card4px12px0px
Floating elevation8px24px-4px
Hard drop shadow6px0px0px
Pressed (inset)2px6px0px

The shadow value is generated locally in your browser — nothing is uploaded.

Ad placeholder (rectangle)