Skip to content

CSS Glassmorphism Generator

Build a frosted-glass card with backdrop blur, tint and shadow, and copy the CSS.

Generated live in your browser.

25%
12px
120%
16px
37%

How do you create a glassmorphism effect in CSS?

Combine a semi-transparent background such as rgba(255, 255, 255, 0.25) with backdrop-filter: blur(12px) saturate(120%), a one-pixel border in a slightly more opaque tint, and a soft box-shadow. Place the element over a photo or gradient — with nothing behind it to blur, the effect disappears.

Understanding your result

Glassmorphism only works when there is something behind the element to blur. Over a flat colour the effect vanishes, so place the card over a photograph, gradient or busy background. The saturate function is what separates a convincing result from a grey smear: blurring alone washes colour out, and pushing saturation slightly above 100% restores it. Be deliberate about performance and accessibility. backdrop-filter forces the browser to composite on the GPU, so animating it or stacking several glass layers can cost real frames on mid-range phones. Text contrast also changes with whatever sits behind the card, so check the worst case against the 4.5:1 ratio WCAG requires for body text.

Formula and method

The effect combines four properties: a semi-transparent background using rgba, a backdrop-filter with blur and optional saturate, a one-pixel border in a slightly more opaque version of the tint, and a large soft box-shadow to lift the surface off the page.

Assumptions and limitations

The effect only appears when there is something behind the element to blur — over a flat colour it disappears. backdrop-filter is GPU-intensive, so animating it or stacking several glass layers can cost frames on lower-end devices, and text contrast changes with whatever sits behind the card.

Worked example

A white tint at 25% opacity with a 12px blur, 120% saturation, a 16px radius and a soft shadow produces the classic frosted card — background: rgba(255, 255, 255, 0.25) with backdrop-filter: blur(12px) saturate(120%).

How to use this tool

  1. Pick a tint colour — white for light themes, a dark shade for dark ones.
  2. Adjust opacity and blur until the backdrop reads as frosted, not muddy.
  3. Raise saturation slightly so colours behind the glass stay vivid.
  4. Copy the CSS and apply the class to your element.

Common mistakes to avoid

  • Placing the card over a flat colour, where there is nothing to blur.
  • Omitting -webkit-backdrop-filter, which older Safari still needs.
  • Setting opacity so high the effect turns into a plain translucent box.
  • Ignoring text contrast over a busy or light background.

About the CSS Glassmorphism Generator

The CSS Glassmorphism Generator builds the frosted-glass effect popularised by macOS and iOS: a translucent tinted surface with a blurred backdrop, a subtle light border and a soft shadow. Adjust the sliders, watch the preview, and copy production-ready CSS with the -webkit- prefix included.

Who should use this tool

Front-end developers and UI designers building modern card, modal and navigation-bar surfaces.

Benefits

  • Live preview over a gradient, so you see the blur actually working.
  • Derives a matching border tint automatically instead of leaving it flat.
  • Includes the -webkit-backdrop-filter prefix for Safari.
  • Saturation control, which is what makes the effect look like real glass.

Practical use cases

  • Designing a translucent card or pricing panel over a hero image.
  • Building a sticky navigation bar that blurs the content behind it.
  • Styling a modal overlay or notification toast.
  • Prototyping a dashboard widget with depth.

Explore all Developer Tools tools

Frequently asked questions

Do all browsers support backdrop-filter?

All current versions of Chrome, Edge, Firefox and Safari do. Safari needed the -webkit- prefix for a long time, so the generated CSS includes both properties.

Why does my glass card look grey?

Either there is nothing colourful behind it, or the saturation is too low. Blurring desaturates by nature, so lift saturate above 100% to bring the colour back.

Is glassmorphism bad for performance?

It is GPU-intensive. One or two static glass surfaces are fine; animating backdrop-filter or stacking many layers will drop frames on lower-end devices.

How do I keep text readable on glass?

Raise the tint opacity, add a subtle text shadow, or place a slightly darker inner layer behind the text. Always test against the busiest part of the background.

What is the difference between filter and backdrop-filter?

filter blurs the element itself, including its text. backdrop-filter blurs only what is behind it, leaving the content sharp — which is what makes the glass effect possible.

Share this tool

Free to use — copy the link, share it anywhere, or add the tool to your own website.

Embed this tool on your site (free)

Copy this code and paste it into any web page — it stays free and always up to date: