Category: Developer tools

Box Shadow Generator

System ideaMissing a tool?

Dial in a shadow with sliders and copy the CSS declaration

Drag offset, blur, spread and opacity sliders against a real browser preview, toggle inset or a derived contact layer, then copy the full box-shadow declaration.

Output
box-shadow: 0px 8px 24px -4px rgba(23, 33, 28, 0.24);

Everything on this page is processed in your browser. Nothing is uploaded.

What this tool does

This box shadow generator turns the numbers you would otherwise guess at into five sliders. Horizontal and vertical offset run from -50 to 50 pixels, blur from 0 to 100, spread from -50 to 50, and opacity from 0 to 1 in steps of 0.02. The colour comes from a native colour picker and is combined with the opacity slider into an rgba() value, so hue and transparency are set separately instead of fighting each other inside one hex string. Switch on inset and the keyword is added to the front of the value, turning the outer shadow into an inner one. Switch on the second layer and a comma-joined layer derived from the first is appended within the same declaration: same colour, half the vertical offset, a quarter of the blur with a one-pixel floor, no spread, and the opacity raised by 0.08 up to a ceiling of 1. That is the tight contact shadow designers pair with a soft one — the thing that stops a card from floating unconvincingly. Blur is clamped at zero and every length is rounded to a whole pixel, so the output is always a valid, tidy value. The preview is not an approximation: the value is applied to a real element on a stage, so what you see is the browser's own rendering of the declaration you are about to copy. That output is complete — box-shadow: 0 10px 20px 0 rgba(15, 23, 42, 0.28); with the property name and trailing semicolon — and one button copies the whole thing. Everything updates as the controls move; there is no generate button. The limits are equally definite. Two layers is the ceiling and the second is derived, not edited: its offset, blur, spread, colour and opacity cannot be set on their own, and there is no third. Only the box-shadow property is generated — no text-shadow, no filter: drop-shadow(), no SVG shadow. Lengths are pixels only, with no em, rem or percentage. Colours come only from the picker plus the opacity slider, so colour keywords, rgb(), hsl() and eight-digit hex are not accepted. There is no preset or elevation scale, no Material levels, and no neumorphism or glow preset. The preview element is fixed: its size, border radius, background colour and the stage behind it cannot be changed. No vendor prefixes are emitted and no rule is wrapped in a selector. There is no Tailwind, SCSS or styled-components output, no image export of the preview and no download, and no saved shadow, history, permalink or side-by-side comparison of two shadows. The offsets, colour and opacity stay in the browser, nothing is uploaded and no asset is fetched at run time.

How to use it

  1. Set the horizontal offset, vertical offset, blur, spread and opacity sliders, then pick the shadow colour.
  2. Turn on inset for an inner shadow, or the second layer for a soft-plus-contact pair in one declaration.
  3. Check the live browser preview and copy the complete box-shadow declaration into your stylesheet.

Privacy

This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.

Frequently asked questions

What do the blur radius and spread radius do?
Blur controls how soft the edge is: a larger value spreads the shadow wider and lighter, and 0 gives a hard edge. Spread grows or shrinks the whole shadow before blurring — positive makes it larger than the element, negative pulls it in. Here blur runs 0 to 100 pixels and spread -50 to 50.
How do I create an inner shadow instead of a drop shadow?
Turn on the inset toggle. That puts the inset keyword at the front of the value, and the shadow is painted inside the box instead of behind it, which is what makes an input or a well look recessed.
Can I apply more than one shadow to an element?
CSS itself allows any number of comma-separated shadows. This tool offers two: the one you control, plus an optional second derived from it — same colour, half the vertical offset, a quarter of the blur with a one-pixel floor, no spread, opacity raised by 0.08. The second layer cannot be edited on its own and there is no third.
box-shadow or filter: drop-shadow() — which should I use?
box-shadow follows the element's box, including its border radius, which is what you want for cards, buttons and inputs. filter: drop-shadow() follows the alpha shape, so it suits transparent PNGs and clipped shapes. This generator emits the box-shadow property only; it does not produce filter or SVG shadows.
Why is the colour written as rgba() instead of hex?
Because transparency has its own slider. The hex value from the native colour picker is combined with the opacity setting into a single rgba() colour, so you can darken or lighten a shadow without touching its hue. Colour keywords, rgb(), hsl() and eight-digit hex are not accepted as input.