Two cards sit side by side on the same page. One looks printed on the screen, flat and deliberate, like a poster. The other looks like a piece of card resting above the surface, lit by the room. Both use the same CSS property, the same color, the same offset. The only difference is one number: the blur radius.
A box shadow is built from a handful of values, and most of them get the attention: how far it falls, how dark it is. But the soft versus hard choice, the one that decides whether an interface feels flat and graphic or soft and physical, comes down to blur alone. Here is what blur does, how each style reads, and how to build both with the free Box Shadow Generator on Ovatly, which runs entirely in your browser.
Contents
- Quick answer
- The parts of one shadow layer
- Blur is the whole difference
- How each style reads
- How to build both styles, step by step
- Worked example: one shadow, two blurs
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
Set the blur radius to 0 and the shadow is a hard-edged offset copy of the box itself. Raise the blur and the edge softens and spreads, and the shadow starts to look like light falling on a surface instead of a shape printed behind the element. To compare the two, open the Box Shadow Generator, set horizontal offset 0px, vertical offset 8px, spread 0px and color #000000 at 20% opacity, then change nothing except the blur: 0 for hard, 24px for soft. Cards and buttons in most interfaces want the soft version. Hard shadows are a deliberate style choice, not a default.
The parts of one shadow layer
A box-shadow value is a list of layers, and the generator builds them one at a time, up to four. Each layer has the same five parts. The horizontal offset moves the shadow left or right. The vertical offset moves it up or down: a positive value puts the shadow below the box, which reads as light coming from above. The blur radius softens the shadow's edge. The spread radius grows or shrinks the shadow itself, and unlike blur it may be negative, which pulls the shadow in tighter than the box. Last comes the color with an opacity, written as rgba(), so black at 20% opacity lands as a grey wash rather than a solid block. A layer can also be inset, tucked inside the box instead of cast outside it. For the soft versus hard choice, though, four of these parts are supporting cast. Only blur changes the character of the edge.
Blur is the whole difference
Blur is measured in pixels: how far the shadow's edge is softened. At blur 0 there is no softening at all: the browser draws an exact copy of the box's silhouette, shifted by the offsets, with an edge as sharp as the box itself. That is a hard shadow. As blur rises, the silhouette dissolves outward. The shadow appears larger, lighter at its edges and darkest near the middle.
Two rules bound the setting. Blur cannot be negative, so there is no way to make an edge sharper than the box itself. Blur also interacts with spread: a negative spread can pull a blurred shadow back in, giving a soft edge on a shadow that stays close to the box's footprint. For the comparison in this guide, though, spread stays at 0, so blur does all the talking.
How each style reads
Readers interpret shadows the way they interpret light in a photograph. A hard shadow with a crisp edge is what strong, direct light produces: sun at noon, a bare bulb. On screen it has come to signal flat graphic design: posters, brutalist layouts. It looks intentional and loud, and it gives no impression of height, because real objects hovering above a surface almost never cast edges that sharp.
A soft shadow is what ambient light produces: an overcast sky, a lamp across the room, light bounced off walls. Its edge has no clear boundary, so the eye reads it as distance. The softer and wider the blur, the higher the element seems to float. This is why cards, dialogs and raised buttons in most interfaces use soft shadows: the blur says this sits above the page, and you can press it.
How to build both styles, step by step
- Open the Box Shadow Generator and start with a single layer.
- Set the horizontal offset to 0px and the vertical offset to 8px, so the shadow falls straight down.
- Set the spread to 0px and the color to #000000 at 20% opacity.
- Set the blur to 0 and look at the preview: a hard shadow, an exact offset copy of the box.
- Now raise the blur to 24px and change nothing else: the same shadow, softened into a pool of shade.
- Copy the declaration for the style that fits, and keep the other values untouched across your components.
Worked example: one shadow, two blurs
Hold everything from the generator's example fixed: offsets of 0px and 8px, spread 0px, black at 20% opacity. With blur at 0, the declaration is:
box-shadow: 0px 8px 0px 0px rgba(0, 0, 0, 0.2);
That shadow is a rectangle the same size as the card, dropped 8px below it, with edges you could rule a line against. On a button in a flat graphic style, it reads as a design statement. On a card that is supposed to look like paper, it reads as a mistake.
Now change only the blur, to 24px:
box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.2);
The footprint melts. The darkest shade sits directly under the card and fades outward, which is what a desk lamp does to a business card on a desk. Same offset, same color, same spread. One number moved, and the card went from printed to resting.
Limitations and honest tradeoffs
A soft shadow is still a flat drawing. Blur can suggest height, but the shadow cannot respond to a real light source in a photograph behind the element, and on a busy background image it can look muddy where a hard shadow would stay legible. The generator also caps a shadow at four layers and works in pixels, so very large elements may want values scaled up by hand. And taste is a real limit: a design system built on hard offset shadows should not have one soft card dropped into it. Consistency reads as quality more than any single value does.
Common mistakes
- Judging blur while everything else changes too. If you change offset, color and blur at once, you learn nothing. Fix the other values and move blur alone.
- Using blur 0 by accident. A forgotten blur setting leaves the hard copy in place, and the element looks pasted on.
- Pushing blur so high the shadow detaches. At extreme values the shade spreads so thin that the eye stops connecting it to the element.
- Mixing styles on one page. One hard-shadow card among soft ones looks like a bug.
- Copying values onto a different background. A shadow tuned on white can vanish or turn dirty on a dark surface. Check it where it will live.
FAQs
What makes a box shadow hard or soft? The blur radius. At blur 0 the shadow is an exact offset copy of the box with a sharp edge. As blur rises, the edge softens and spreads, and the shadow starts to look like shade pooled on a surface instead of a shape printed behind the element.
What blur should I use for a card? There is no single correct value, but the worked example in this guide is a good reference point: offsets of 0px and 8px with 24px of blur reads clearly soft. Judge the result against your own background, and keep the blur consistent across every card on the page.
Can the blur radius be negative? No. Blur cannot be negative, so a shadow edge can never be sharper than the box itself. Spread is the value that may go negative, which pulls the shadow in tighter than the box's footprint.
Does a hard shadow ever look right? Yes, when it is the style. Hard offset shadows suit flat, graphic and neo-brutalist designs, and they stay legible on busy backgrounds where a soft shadow would turn muddy. They fail when the rest of the interface is trying to look physical and softly lit.
Is anything uploaded when I use the generator? No. The Box Shadow Generator runs in your browser and produces a CSS declaration for you to copy. Nothing about your design or your values is sent anywhere.
Conclusion
Soft versus hard is one decision, made with one number. Blur 0 gives you a graphic offset block; a generous blur gives you ambient light and the impression of height. The Box Shadow Generator lets you flip between the two until the reading is right. When one soft layer still looks pasted on, the next step is stacking a second layer, which our guide to creating a layered box shadow for a realistic card covers in full. For more guides in this series, see our Website and Webmaster Tools guides.
References
- MDN Web Docs, on the box-shadow property, its values and how multiple shadows layer: https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow