CSS filter vs backdrop-filter — When to Use Each
CSS filter and backdrop-filter accept the same functions but apply them to different things. Understanding when to use each one is essential for creating blur overlays, frosted glass UIs, and image effects correctly.
CSS Filter Generator
Build CSS filter effects visually — blur, brightness, contrast, grayscale, hue-rotate, invert, opacity, saturate, sepia, and drop-shadow. Preview in real time and copy production-ready CSS.
Presets
Filters
Drop Shadow
Preview
CSS Output
filter: none;
Ctrl+Enter to copy
Filter Reference
| Function | Range | Default |
|---|---|---|
| blur() | 0–20px | 0px |
| brightness() | 0–300% | 100% |
| contrast() | 0–300% | 100% |
| grayscale() | 0–100% | 0% |
| hue-rotate() | 0–360deg | 0deg |
| invert() | 0–100% | 0% |
| opacity() | 0–100% | 100% |
| saturate() | 0–300% | 100% |
| sepia() | 0–100% | 0% |
| drop-shadow() | x y blur color | — |
filter applies to the element itself
The filter property modifies the visual rendering of the element and everything inside it — text, images, children, borders, and backgrounds. If you blur a container with filter: blur(5px), all its children become blurry too. This is ideal for image effects, dimming elements, or creating disabled states. The element's box model and layout are not affected.
/* filter vs backdrop-filter — when to use each */
/* filter — applies to the ELEMENT itself */
.blurred-image {
filter: blur(4px); /* blurs the image */
}
/* backdrop-filter — applies to what's BEHIND the element */
.glass-card {
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px); /* blurs the background */
-webkit-backdrop-filter: blur(10px); /* Safari support */
border: 1px solid rgba(255, 255, 255, 0.3);
}
/* Common backdrop-filter uses */
.frosted-nav { backdrop-filter: blur(20px) saturate(180%); }
.modal-overlay { backdrop-filter: blur(4px) brightness(0.5); }
.tooltip { backdrop-filter: blur(8px); }
/* Key difference:
filter: affects the element's own rendering
backdrop-filter: affects what's visible behind the element */backdrop-filter applies to what is behind the element
The backdrop-filter property applies effects to the area behind an element, not the element itself. The element must have a partially transparent or semi-transparent background for the effect to be visible. This is how you create frosted glass overlays, blurred navigation bars over scrolling content, and modal backdrops. Common use: background: rgba(255,255,255,0.3) with backdrop-filter: blur(10px).
Choosing the right property
Use filter when you want to modify how an element looks — image effects, grayscale, brightness adjustments, drop shadows that follow alpha channels. Use backdrop-filter when you want to modify what appears behind an element — frosted glass cards, blurred modal overlays, navigation bars with blur-through. If you need to blur a background image without blurring the text above it, backdrop-filter is the right choice.
Frequently Asked Questions
Does backdrop-filter work in all browsers?
Yes, as of 2024 backdrop-filter is supported in all modern browsers including Chrome, Firefox (since v103), Safari, and Edge. Safari was actually the first to implement it. For older Firefox versions, you can use @supports (backdrop-filter: blur(1px)) to provide a fallback with a solid semi-transparent background.
Can I use filter and backdrop-filter together?
Yes. They are independent properties that can be applied to the same element. filter modifies the element's rendering, and backdrop-filter modifies the backdrop behind it. For example, you could use backdrop-filter: blur(10px) for a frosted glass effect while also applying filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)) for a shadow.
Why is my backdrop-filter not working?
The most common cause is a fully opaque background on the element. backdrop-filter only affects what is visible behind the element, so the element needs a transparent or semi-transparent background (e.g., background: rgba(255,255,255,0.3)). Also check that no parent element has a filter applied — this creates a new stacking context that can break backdrop-filter.
Related Generate Tools
Security Headers Generator
Generate HTTP security headers for Nginx, Apache, Vercel, Netlify, and Cloudflare with presets, security scoring, and multi-format output
JSON to GraphQL Schema
Generate GraphQL schema definitions from JSON data with automatic type inference, Query/Mutation generation, and .graphql download
HTTP Request Builder
Build HTTP requests visually and generate code in cURL, JavaScript, Python, Go, Rust, and PHP — lightweight Postman/ReqBin alternative
HTML Table Generator
Build HTML tables visually with an interactive editor — add rows, columns, header rows, captions, and styling. Export as plain HTML, inline CSS, or Tailwind classes