Free tool · Design and colour
Glassmorphism generator
Adjust blur, transparency, saturation, border, radius and shadow on a live frosted-glass card, then copy the CSS with the -webkit- line and a fallback.
- Free
- No sign-up
- Runs in your browser
blur(12px) saturate(140%)25% #FFFFFF glass, 20px corners
- -webkit- line included
- @supports fallback
- Readable text
.glass-bg {
background: linear-gradient(135deg, #F472B6, #C084FC, #60A5FA);
}
.glass {
background: rgba(255, 255, 255, 0.25);
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 20px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
-webkit-backdrop-filter: blur(12px) saturate(140%);
backdrop-filter: blur(12px) saturate(140%);
color: #0F172A;
}
@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
.glass {
background: rgba(255, 255, 255, 0.85);
}
}
- Glass opacity
- 25%
- Text contrast
- 8.45:1
- Fallback opacity
- 85%
The effect only shows when the card is translucent and something is behind it. The contrast figure is an estimate: it saturates the background, lays the tint over it and checks the text against the lowest-contrast part. Check the real page too.
How to use the Glassmorphism Generator
- Pick a Background gradient, or choose your own image. The image stays on your device.
- Move the sliders for Blur, Transparency, Saturation, Border opacity, Corner radius and Shadow strength, and watch the card at the top.
- Set the Glass tint and the Text color (HEX, RGB or HSL, or the Pick swatches).
- Read the contrast message under the result. If it warns, lower the transparency or change the text color.
- Press Copy CSS. Turn off the fallback or the background rule if you do not need them.
How do I make a frosted glass effect in CSS?
Give the element a translucent background and add backdrop-filter: blur(). The filter blurs whatever sits behind the element and the translucent background tints it, which together look like frosted glass. MDN states that the element or its background must be at least partly transparent, or the effect cannot be seen.
The default settings write a white layer that is 25% opaque (transparency 75%), a blur of 12 px with saturation raised to 140%, a thin border in the same tint, rounded corners and a soft shadow. Each slider changes exactly one value, as the table shows. Blur softens the background, saturation keeps its colors from washing out under the white layer, and the border and shadow separate the card from what is behind it.
| Control | CSS it writes | Range |
|---|---|---|
| Blur | backdrop-filter: blur(12px) saturate(140%) | 0 to 40 px |
| Saturation | same line, saturate(140%) | 100% to 250% |
| Transparency | background: rgba(255, 255, 255, 0.25) | 0% to 100% |
| Border opacity | border: 1px solid rgba(255, 255, 255, 0.3) | 0% to 100% |
| Corner radius | border-radius: 20px | 0 to 64 px |
| Shadow strength | box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) | 0% to 100% |
Transparency is the opposite of the alpha value: 75% transparency is an alpha of 0.25, 0% is fully solid and 100% is fully clear. Blur 0 with saturation 100% writes no filter at all, and the card is then only a translucent box.
Does backdrop-filter work in all browsers?
It works in the current versions of all major browsers. MDN lists backdrop-filter as Baseline 2024 and says it has worked across the latest devices and browser versions since September 2024, while it may not work on older ones. The caniuse data shows why the output carries two lines: Safari 9 through 17.6 and iOS Safari 9.0 through 17.7 understand only the prefixed name, -webkit-backdrop-filter. Safari 18 and iOS Safari 18 read the unprefixed one.
In the same data the unprefixed property starts in Chrome 76, Edge 79 and Firefox 103. The generator writes the prefixed line first and the standard line after it, so the browsers that know both end up using the standard one. A browser that knows neither ignores both lines, and the fallback below takes over.
How do I add a fallback when backdrop-filter is unsupported?
Put a more opaque background inside an @supports block that tests for both property names. The generator writes @supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) and, inside it, a background with an alpha of at least 0.85. For the default card that is 0.85 instead of 0.25. MDN documents @supports as widely available, including the not and or operators and the need for parentheses when they are mixed.
Read the condition from the inside out. Each test asks whether the browser understands that property with the value none. The or joins the prefixed and the standard name, so it is true if either one works, and not flips the result. The block therefore applies only in a browser that understands neither name.
The fallback matters because without the blur, a 25% white layer lets the background show straight through the text. Browsers that support the filter never apply the block, so nothing changes for them. Switch the option off if your layout never sits over busy content, or if you write the fallback yourself.
How do I keep text readable on glass?
Check the text against the worst part of the background, not the average. The tool does this for every gradient and for your own image: it applies the saturation to the background colors, lays the tint over them at its opacity and computes the WCAG contrast ratio of your text color against each result. The saturation step uses the matrix from the Filter Effects specification. The lowest ratio is the one reported, because blur only averages the colors nearby, so for plain light or dark text the estimate errs on the cautious side.
WCAG success criterion 1.4.3 asks for at least 4.5:1 for normal text and 3:1 for large text. The table shows what that means on the six gradients, with the default 25% white glass and with a 60% one. White text on the Aurora gradient reaches only 1.47:1 at 25% glass. Dark text (#0F172A) reaches 3.38:1, and 8.02:1 once the glass is 60% opaque.
| Gradient | White text, 25% glass | Dark text, 25% glass | Dark text, 60% glass |
|---|---|---|---|
| Aurora | 1.47:1 | 3.38:1 | 8.02:1 |
| Sunset | 2.27:1 | 4.45:1 | 8.81:1 |
| Ocean | 1.99:1 | 2.53:1 | 7.30:1 |
| Forest | 1.20:1 | 3.93:1 | 8.66:1 |
| Midnight | 3.55:1 | 2.25:1 | 6.99:1 |
| Candy | 1.98:1 | 8.45:1 | 11.93:1 |
More opacity helps dark text and hurts white text, because a white layer pulls every background toward white. For white text, a dark tint works better than a white one: on Midnight, white text on 25% white glass gives 3.55:1, while a #0F172A tint at the same opacity gives 7.45:1. The contrast checker tests any exact pair, and the box shadow generator builds a layered shadow if the default one is not enough.
Is glassmorphism bad for accessibility?
It can be, because the contrast of text on glass depends on what is behind it, and that changes as content scrolls or as the user switches themes. The WCAG minimums still apply to text on a translucent card. Keep the glass opaque enough that the lowest figure in the result stays at 4.5:1 or above, and keep body text off the busiest parts of an image.
Some people turn on a system setting to reduce transparency. The prefers-reduced-transparency media feature reports that choice, with the values no-preference and reduce. MDN marks it as limited availability and not Baseline, so use it as an extra and not as the only protection. A rule such as @media (prefers-reduced-transparency: reduce) that sets a solid background on the card is a safe addition.
If the blur seems to do nothing, check the parents. MDN explains that backdrop-filter reaches only up to the nearest backdrop root, and that an ancestor with opacity below 1, a filter or its own backdrop-filter becomes one. A card inside a half-transparent parent then blurs only what lies between the two. For colors in other notations use the hex to RGB converter.
Use it with
- Color Contrast Checker: WCAG contrast ratio.
- Box Shadow Generator: visual CSS box-shadow builder.
- HEX to RGB Converter: HEX, RGB, HSL, CMYK conversions.
Questions
How do I make a glassmorphism effect in CSS?
Use a translucent background and backdrop-filter: blur(). The default here is background: rgba(255, 255, 255, 0.25) with backdrop-filter: blur(12px) saturate(140%). Copy the full block, with the -webkit- line, from the result.
Does backdrop-filter work in Safari, Chrome and Firefox?
Yes, in current versions. In the caniuse data Chrome supports it from 76, Edge from 79, Firefox from 103 and Safari from 18. Safari 9 to 17.6 needs the -webkit- prefix, which the generated CSS includes.
Why is my backdrop-filter not working?
The element or its background has to be partly transparent, and there must be something behind it to blur. A parent with opacity below 1, a filter or another backdrop-filter also stops the blur from reaching the page behind it.
What contrast do I need for text on glass?
WCAG asks for at least 4.5:1 for normal text. On the Aurora gradient, dark text on 25% white glass gives 3.38:1 and white text 1.47:1, so the tool warns about both.
What if a browser does not support backdrop-filter?
It ignores the filter lines, and the @supports block gives the card a more opaque background (0.85 alpha for the default card) so the text stays readable.
Is my background image uploaded?
No. The picture is read and shown by your browser, and nothing you choose or type leaves your device.
Sources
The tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations are checked against the tool's own output.