CSS Filter Generator
Generate CSS filter effects visually. Adjust blur, brightness, contrast, grayscale, hue-rotate, invert, opacity, saturate, and sepia with sliders. Upload your own image for live preview. Free online CSS filter generator.
- Runs in your browser
- Your data never leaves your browser
- Free · No Sign-Up
Scan with WeChat to share this tool
Examples, details and FAQ Worked examples, how it compares with other tools, and answers to common questions.
Understanding the Generated CSS
The output sets the filter property on an .element class. Replace
.element with your own selector and apply the declaration to any HTML element —
images, divs, canvases, videos, or pseudo-elements. Filter values are evaluated in order, so
blur(2px) brightness(120%) first blurs and then brightens, which may produce
a slightly different result than applying the functions in reverse.
Example: Grayscale Logos That Color on Hover
Set Grayscale to 100 and Contrast to 110. The tool writes:
.element {
filter: contrast(110%) grayscale(100%);
}
Use it as the resting state of a logo strip and add .element:hover { filter: none; } with transition: filter 0.3s. The transition is smooth because one side is none.
Example: Reusing Light Screenshots in Dark Mode
Set Invert to 100 and Hue Rotate to 180:
.element {
filter: hue-rotate(180deg) invert(100%);
}
White backgrounds turn black and the 180° rotation brings hues back near their original color: drawn in Chrome with this filter, #1a73e8 became rgb(72, 161, 255), a lighter blue, instead of the orange that invert alone gives. Apply it inside @media (prefers-color-scheme: dark) to diagrams and screenshots only; photos look wrong inverted.
Function Order and Limits
- Fixed order. The output always lists functions in the slider order (blur, brightness, contrast, grayscale, hue-rotate, invert, opacity, saturate, sepia), and the preview uses the same string. Order matters once a channel clips: on a
#999999fill,brightness(200%) contrast(50%)givesrgb(191, 191, 191), whilecontrast(50%) brightness(200%)gives white. Reorder the functions by hand if you need a different sequence. - Ranges: blur 0–20px in 0.1px steps, brightness, contrast and saturate 0–200%, hue-rotate 0–360deg, the rest 0–100%. The spec accepts larger values (brightness, contrast and saturate have no upper limit); type them into the CSS yourself.
- Not included:
drop-shadow()andurl()references to SVG filters. For blurring what is behind a glass panel, the property isbackdrop-filter, notfilter:filter: blur()blurs the element itself, text included. - Containing block. Any value other than
nonemakes the element the containing block for absolutely and fixed-positioned descendants, unless the element is the document root (html) (Filter Effects Level 1). - Preview images are limited to 5 MB (5,242,880 bytes) and stay in the page. A larger file, a file that is not an image, or one this browser cannot decode (an empty file, a text file renamed to .png, HEIC where the browser has no HEIC decoder) is not loaded: the status line gives the reason and the preview keeps the current image. A file counts as an image when the browser reports an image type or the name ends in a common image extension, so an image file without an extension is rejected. The slider values are saved in this browser so the tool reopens with your last settings.
The filter property works without a prefix in Chrome 53, Firefox 35 and Safari 9.1 and later (MDN browser compat data). For shadows around the element’s box, use the box shadow generator.
Example: Zero Brightness and Opacity
Set Brightness and Opacity to zero while leaving the other seven controls at their defaults. The generator preserves both zero values and writes brightness before opacity. Reset Opacity alone to 100 to remove opacity() from the rule; brightness(0%) stays.
.element {
filter: brightness(0%) opacity(0%);
} FAQ
What is the CSS filter property?
The CSS filter property applies graphical effects such as blur, color shift, and brightness adjustments to an element. It accepts a space-separated list of filter functions: blur(), brightness(), contrast(), grayscale(), hue-rotate(), invert(), opacity(), saturate(), and sepia(). The functions are applied in the order written, left to right.
Why does the output omit filter functions at their default values?
Including a filter function at its default value (e.g., brightness(100%) or blur(0px)) has no visual effect but adds unnecessary bytes. This generator only outputs the functions where values differ from the default, keeping the CSS minimal. When all sliders are at their defaults the output is filter: none;, which explicitly overrides a filter set by another rule on the same element (filter is not inherited).
How do I apply the filter to an image on my page?
Copy the generated CSS and add the filter property to your target element's ruleset. For example: img { filter: blur(4px) brightness(120%); }. You can also apply filters to non-image elements like div or section — the effect renders on the element and all its children as a single composited layer.
Can I animate CSS filters?
Yes. Use transition: filter 0.3s ease; and change the value on hover or focus. Filter Effects Level 1 §14.1 interpolates smoothly when both values list the same functions in the same order, when one list extends the other, or when one side is none; any other pair (for example grayscale(100%) blur(2px) to blur(2px)) switches at once without a transition. Because this tool drops functions at their default value, write both states with the same function list when you animate.
What is the difference between opacity() filter and the CSS opacity property?
On their own they look the same, and both create a stacking context and render the element with its descendants as one group. The differences: filter: opacity() runs at its position in the filter chain, and any filter other than none also makes the element (unless it is the root html element) the containing block for position: fixed and absolute descendants, so a fixed header inside a filtered element stops sticking to the viewport. The opacity property does not do that.
Is my image uploaded, and are my settings saved?
The image is not uploaded. FileReader reads the file inside this page, and it is not stored, so it is gone when you leave the page or press Ctrl/⌘+L in the tool. The nine filter values are saved in this browser's local storage so the tool reopens with your last settings; Reset All puts them back to the defaults. Neither the image nor the values are sent to ZeroTool.