World’s largest virtual agentic engineering & quality conference
Generate CSS filter drop-shadow code that follows the real shape of transparent PNGs, SVG icons, and cutouts. Adjust offset, blur, and color with a live preview and copy the result, right in your browser.
box-shadow: 10px 10px 18px 0px rgba(0, 0, 0, 0.35);
-webkit-box-shadow: 10px 10px 18px 0px rgba(0, 0, 0, 0.35);
-moz-box-shadow: 10px 10px 18px 0px rgba(0, 0, 0, 0.35);The Drop Shadow Generator is a free online tool that produces CSS for the filter: drop-shadow() function. The key difference from box-shadow is that drop-shadow respects transparency. It reads the alpha channel of your element and casts the shadow around the visible pixels, which is exactly what you want for a transparent PNG, an SVG icon, or any shape that is not a solid rectangle.
The tool exposes the parts of the function you can control: the horizontal and vertical offset that set direction, the blur radius that softens the edge, and the color with opacity. There is no spread value and no inset keyword, because the filter simply traces the shape of your content. As you adjust the controls, the preview shows the shadow following the real outline.
You can apply a shape-aware shadow in under a minute. Follow these steps:
The function is intentionally simple, but each value changes the result. Here is what the controls do:
Choosing between these two comes down to one question: is your element a solid box or a shape with transparency. This page focuses on drop-shadow, and the table shows where it wins:
| Question | Use drop-shadow when | Use box-shadow when |
|---|---|---|
| Is the element transparent? | Yes, a PNG or SVG with see-through areas | No, a solid filled element |
| Should the shadow follow the content? | Yes, around the visible shape | No, a rectangular box is fine |
| Do you need inset or spread? | No, the filter has neither | Yes, those are box-shadow features |
| Typical target | Icons, logos, cutouts, illustrations | Cards, buttons, inputs, modals |
For solid rectangular UI like cards and buttons, the Box Shadow Generator is the better fit and supports inset and spread.
drop-shadow solves a specific problem that box-shadow cannot. These are the places it shines:
When you need very precise vector control, SVG feDropShadow is an alternative worth knowing, though the CSS filter covers most needs. This tool is maintained by TestMu AI (formerly LambdaTest), the team behind a unified testing platform, so it is built with consistent cross-browser rendering in mind.
drop-shadow is a CSS filter function that casts a shadow following the visible shape of an element, including transparency. Unlike box-shadow, it respects the alpha channel, so a transparent PNG or SVG icon gets a shadow around its real outline.
Use drop-shadow for transparent images, SVG icons, logos, and irregular shapes where the shadow should hug the content. Use box-shadow for solid rectangular elements like cards and buttons where a box-shaped shadow is correct.
Apply filter drop-shadow to the image element. Because the filter follows the alpha channel, the shadow appears only around the visible pixels of the PNG, not around its transparent rectangular bounds.
Yes. That is its defining behavior. The filter reads the non-transparent pixels and draws the shadow around that exact shape, which is why it works so well for icons, cutouts, and logos with transparency.
Write filter: drop-shadow(offset-x offset-y blur-radius color). For example, filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.4)). Note that drop-shadow has no spread value and no inset option, unlike box-shadow.
Yes. Chain several drop-shadow functions in one filter declaration, separated by spaces. Each is applied in turn, which lets you build layered or multi-directional shadows on the same transparent shape.
CSS filter drop-shadow is simpler and great for most cases. SVG feDropShadow gives finer control inside an SVG and can be more efficient for complex vector graphics, so reach for it when you need precise, self-contained SVG effects.
Yes. The filter drop-shadow function has broad support across modern browsers. It can be hardware accelerated, though very large or animated filters should be tested for performance on lower-powered devices.
Did you find this page helpful?
World’s largest virtual agentic engineering & quality conference