ToolJutsu
All tools
Color & Design Tools

Box-Shadow Generator

Design CSS box-shadows with a live preview.

box-shadow: 0px 10px 25px -5px #0F172A;
Shadow layer 1
Processed on your device. We never see your files.

How to use Box-Shadow Generator

What this tool does

The Box-Shadow Generator lets you design CSS box-shadows visually and copies the finished declaration for you. Each shadow is a layer with six controls — offset X, offset Y, blur radius, spread radius, colour and an inset toggle — and you can stack as many layers as you like. A live preview shows a sample box with the exact shadow applied, updating the instant you move a slider. The output is a ready-to-paste box-shadow declaration. All of the rendering and maths happens locally in your browser.

Use cases

Shadows are the quietest but most powerful depth cue in interface design. A card that floats above the page needs a soft, wide shadow; a button that should feel clickable benefits from a tighter one that deepens on hover. Inset shadows turn a plain rectangle into a recessed input well or a pressed-button state. Designers assembling a component library can define a small set of elevation tokens — resting, raised and overlay — and copy each one as reusable CSS. Developers reproducing a mock-up can dial in the precise offsets a designer specified instead of guessing. Hobbyists building landing pages, dashboards or game menus get a fast way to make flat boxes feel tangible without any image assets.

Depth also communicates hierarchy. A modal or dropdown sits visually closer to the viewer than the page behind it, and a wider, darker shadow tells the eye exactly that. Toast notifications, popovers and tooltips all use shadow to read as temporary layers floating over content. On branding work, a coloured shadow tinted toward an accent hue gives product shots and feature tiles a distinctive glow that a plain grey shadow never achieves.

A worked example

Say you want a card that looks gently raised. Start the first layer with a small footprint: offset X 0, offset Y 1, blur 2, spread 0, in a dark colour at low opacity. Add a second layer for the soft ambient halo: offset X 0, offset Y 8, blur 24, spread -4, in the same colour but even more transparent. The tight layer anchors the card to the surface while the wide, negatively-spread layer fades out naturally instead of bleeding into neighbours. Copy the combined declaration and you have a believable resting elevation you can reuse anywhere.

How to use it

  1. Adjust the four sliders for the first layer — offset X, offset Y, blur radius and spread radius — and watch the preview respond.
  2. Set the shadow colour with the native colour picker or by typing a hex value into the text field.
  3. Toggle inset if you want the shadow drawn inside the element instead of outside it.
  4. Click Add layer to stack another shadow, then tune it the same way. Use Remove to delete a layer; at least one always remains.
  5. When the preview looks right, press Copy CSS to copy the complete box-shadow declaration, or use the inline copy icon on the code line.
  6. Press Reset to return to the default single-layer shadow.

Tips

Realistic shadows are soft and never pure black — pick a dark colour and give it generous blur. The most convincing depth comes from two layers: a small, slightly darker shadow close to the element plus a larger, softer one spread wider. A negative spread on the wide layer keeps it from bleeding too far. For hover states, increase offset Y and blur slightly so the element appears to lift. Keep elevation consistent across a project by reusing the same handful of shadow recipes rather than inventing a new one per component. Watch the blur radius on large or numerous elements: very wide blur values are more expensive to paint, and a long list of heavily blurred shadows on a scrolling page can cause visible jank. If you animate a shadow, transition a second pre-rendered layer’s opacity or use a pseudo-element rather than animating the blur itself, since changing blur forces the browser to repaint on every frame.

Box-shadows pair naturally with the Border-Radius Generator, since rounded corners and shadows together define a card’s silhouette. The Gradient Generator gives the surface itself depth, and the Text-Shadow Generator handles legibility of any heading sitting on top. If a shadow uses a tinted colour, the Color Converter helps you express it as RGB or HSL where needed, and a contrast checker confirms surrounding text stays readable. For interactive depth, combine the copied declaration with a CSS transition on box-shadow so elements animate smoothly between elevation states.

Frequently asked questions

What do offset, blur and spread actually control?
Offset X and Offset Y move the shadow sideways and up or down — positive Y casts the shadow below the element. Blur radius softens the edge: zero is razor-sharp, larger values fade it out. Spread radius grows or shrinks the shadow before the blur is applied, so a positive spread makes a fatter shadow and a negative spread pulls it in tight, which is useful for layered depth.
What does the inset toggle do?
By default a box-shadow is cast outside the element. Switching on inset draws the shadow inside the border instead, which makes the element look pressed in or recessed. Inset shadows are great for input fields, toggle wells and pressed-button states. You can mix inset and outset layers in the same declaration.
How do multiple shadow layers work?
CSS lets you list several shadows on one element, separated by commas, and the browser paints them from the last listed to the first. Stacking layers is how you build realistic depth — for example a tight dark shadow close to the element plus a wide soft one further out. This tool manages each layer separately and joins them into one declaration for you.
Why does my shadow look harsh or muddy?
A common cause is a fully opaque, very dark colour. Real shadows are soft and slightly transparent, so reach for a dark colour with some blur and consider a subtle spread. Using two layers — one small and darker, one large and lighter — almost always reads more naturally than a single heavy shadow.
Does this tool send my design anywhere?
No. Every shadow value is calculated by JavaScript in your browser and rendered live on the page. The offsets, colours and layers you configure never leave your device, and there is no upload, account or tracking involved.

Related tools