CSS Glassmorphism Generator
Frosted Glass with a Contrast Check
Build a frosted glass card and copy the CSS. Tune blur, saturation, tint, border, radius and shadow over a gradient or your own image, get backdrop-filter with its -webkit- line, a fallback rule, a contrast warning and Tailwind classes. 100% client-side. Zero data stored.
CSS Glassmorphism Generator Tool
Make a Frosted Glass Card
Presets
Your image is read in this browser and never uploaded. It also cannot be saved in a link.
Frosted glass card
Text on glass has to stay readable over every part of the background. Check the contrast figure below as you change the tint.
Read moreThis is an estimate. It lays the tint over each color of the background (for an image, 16 sampled areas) and reports the worst ratio. A real blur averages neighboring colors, and the decorative circles are not counted.
CSS
Keep both backdrop-filter lines: older Safari needs the -webkit- prefix and every other browser reads the unprefixed one.
Fallback rule
Where backdrop-filter is not supported the card would show only the faint tint, so this rule swaps in a solid color close to the look. The color is estimated from the background colors, so adjust it to your page.
Tailwind CSS
The supports-[backdrop-filter] variant applies the tint only where blur works, and the plain background is the fallback. Tailwind 3.2 and later, including 4.
Common Use Cases
Cards and Panels
Put a frosted card over a hero image or gradient so the text stays readable without hiding the picture.
Navigation Bars
Make a sticky header that blurs the page scrolling under it, with a border and a soft shadow.
Modals and Overlays
Blur the page behind a dialog so the content stays in view but the focus moves to the dialog.
Accessible Text on Glass
Watch the contrast figure while you change the tint and text color, and stay at 4.5 to 1 or better for normal text.
Safe Fallbacks
Copy the fallback rule so browsers and contexts without backdrop-filter still get a readable solid card.
Tailwind Projects
Get arbitrary-value classes, including the supports variant, for projects that style with utilities.
Glassmorphism Reference
The Parts of a Glass Card
| Part | Typical value | What it does |
|---|---|---|
| backdrop-filter: blur() | 8px to 24px | Blurs what is behind the card |
| saturate() | 120% to 200% | Brings back color the blur washes out |
| background | rgba(255, 255, 255, 0.15) | The tint; low opacity keeps it see-through |
| border | 1px solid rgba(255, 255, 255, 0.3) | A light edge that catches the eye |
| border-radius | 12px to 28px | Soft corners |
| box-shadow | 0 8px 32px rgba(0, 0, 0, 0.25) | Lifts the card off the background |
Zero values are left out of the output.
WCAG Contrast Targets
| Level | Ratio | Applies to |
|---|---|---|
| AA, normal text | 4.5 : 1 | Body text under 24px, or under 19px bold |
| AA, large text | 3 : 1 | 24px and up, or 19px bold and up |
| AAA, normal text | 7 : 1 | The stricter enhanced level |
The warning on this page uses the AA level for normal text, 4.5 to 1.
It needs something behind it
The blur works on whatever is painted behind the card. Over a flat color there is nothing to blur, and an ancestor with its own filter, mask or opacity below 1 can stop it from seeing the page.
Large blurs cost speed
Blurring is expensive on large cards, many cards and animated backgrounds. Keep the blur modest and use few glass layers on weak devices.
Check real text, real image
A photo has bright and dark patches, so one card can pass over one part and fail over another. Test the contrast over the worst part of your actual background.
Related tools
Add depth with the Box Shadow Generator, build the background with the Gradient Generator and check colors with the Color Converter.
Pro Tip: URL Parameters
Open the generator with a card already loaded. Use ?preset= with frost, dark, tinted or subtle, or set each value with ?blur=, ?sat=, ?tint=, ?ta=, ?ba=, ?r=, ?sh=, ?bg= and ?text=. For example: /glassmorphism-generator/?preset=dark or /glassmorphism-generator/?blur=20&sat=160&tint=ffffff&ta=0.2&bg=sunset
blur and r are pixels, sat is a percentage, ta and ba are 0 to 1 opacities, sh is the shadow size in pixels, colors are HEX without the #, and bg is aurora, sunset, ocean or sample. An image you pick yourself cannot be put in a link. The link in your address bar updates only after you change something, and the Copy Link button builds it from your current card.
Frequently Asked Questions
Glassmorphism is a frosted-glass look: a translucent card that blurs whatever sits behind it. In CSS it comes from backdrop-filter, which applies a filter such as blur() to the area behind an element, combined with a low-opacity background tint, a light border and a soft shadow. The filter changes only what is behind the card, not the card contents.
Safari supported only the -webkit- prefixed property for years, and unprefixed backdrop-filter arrived in Safari 18. Writing both lines keeps older Safari versions working while every other browser reads the unprefixed one. The tool always writes the pair with the same value.
The blur needs something painted behind the card. Over a flat color there is nothing to blur. An ancestor with its own filter, mask, clip-path or opacity below 1 can also limit what the card can see, and a fully opaque background hides the blur completely. Put the card over an image or gradient, and check its parents.
It means the text color may be hard to read on the tinted glass over some part of the background. WCAG AA asks for a contrast ratio of at least 4.5 to 1 for normal text and 3 to 1 for large text. Raise the tint opacity, darken the tint, or change the text color until the warning goes away.
It lays your tint over each color of the chosen background, applies the saturation, and compares your text color to every result using the WCAG formula. For a gradient it uses the gradient colors, and for an image it samples 16 areas. The worst ratio is shown. It is an estimate: a real blur averages neighboring colors, so test your real page too.
Some browsers, and some contexts, cannot blur what is behind an element. There the card would show only the faint tint and the text could be unreadable. The fallback is an @supports not rule that swaps in a solid color close to the glass look. The color is estimated from the background, so adjust it to your page.
It can be. The browser has to blur the pixels behind the card on every paint, so big cards, large blur values, several stacked glass layers and animated backgrounds can cost frames on weak devices. Keep the blur moderate, use fewer layers, and avoid animating what is behind a glass card.
Copy the classes. The background is a plain arbitrary color that doubles as the fallback, and the tint is applied through the supports-[backdrop-filter] variant, so it only appears where blur works. The blur and saturation use backdrop-blur and backdrop-saturate arbitrary values. The variant needs Tailwind 3.2 or later, including 4.
Yes. Choose a file under Use your own image. It is read in your browser with an object URL, sampled on a canvas for the contrast estimate and never uploaded. Because it never leaves your device, a link cannot carry it, so a shared link opens with the aurora gradient instead.
Yes to the link. Use ?preset= with frost, dark, tinted or subtle, or set each value with ?blur=, ?sat=, ?tint=, ?ta=, ?ba=, ?r=, ?sh=, ?bg= and ?text=. The Copy Link button builds the link from your current card. Nothing is sent anywhere: the preview, the contrast estimate and the CSS are all made in your browser.
Why We Built This Glassmorphism Generator
Glass cards look easy and are easy to get wrong. The blur does nothing over a flat color, the tint has to be faint enough to see through yet strong enough to read the text, the prefixed property is still needed for older Safari, and in the browsers and contexts that cannot blur, the card quietly turns into unreadable text on a background. We built a generator that shows the card over a real backdrop, writes the CSS correctly, and tells you when the text is too hard to read.
The output is the shortest valid form: neutral values are left out, backdrop-filter always comes with its -webkit- twin, and a fallback rule gives unsupported browsers a solid card close to the look. You also get Tailwind classes, a downloadable stylesheet, and a link that restores the design. Your own image is read in the browser and never uploaded, and nothing you design leaves the page.
The Glassmorphism Generator is part of RJL.io's collection of free developer tools. Add depth with the Box Shadow Generator, build backgrounds with the Gradient Generator, and cut shapes with the Clip Path Generator.