Skip to main content
CalcChef

CSS Glassmorphism Generator

Set blur, saturation, tint opacity, corner radius, shadow and inner glow for a frosted glass panel and copy the backdrop-filter CSS, SCSS or Tailwind classes. How it works

Use the CSS Glassmorphism Generator

Presets:
16px
0.5

0 is clear glass, 1 is solid

180%
16px
20px
5px
0

White glow 0px deep along the inside edge

1px

0 removes the border

0.3
Glassmorphism
CSS
/* backdrop-filter support (MDN browser-compat-data): unprefixed in Chrome 76, Edge 79, Firefox 103 and Safari 18.
 * Safari 9 to 17 only understands -webkit-backdrop-filter, so both are written. */
.glass {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Browsers that understand neither spelling get a more opaque tint so the text stays readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: rgba(255, 255, 255, 0.6);
  }
}

Export Format
Preview Mode
Background

About the CSS Glassmorphism Generator

Glassmorphism in CSS is a partly transparent background plus backdrop-filter: the starting glass here is background: rgba(255, 255, 255, 0.5), backdrop-filter: blur(16px) saturate(180%), border: 1px solid rgba(255, 255, 255, 0.3), border-radius: 16px and box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1). The CSS Glassmorphism Generator writes backdrop-filter and -webkit-backdrop-filter, because Safari 9 to 17 reads only the prefixed name.

backdrop-filter browser support (MDN browser-compat-data)

Browserbackdrop-filter from-webkit-backdrop-filter
Chrome76No
Edge7917 to 78
Firefox103No
Safari18From 9
Safari on iOSSame as SafariSame as Safari

MDN lists backdrop-filter as Baseline 2024, working across the latest browsers since September 2024. Chrome for Android follows Chrome.

The built-in presets and the CSS they write

Presetbackgroundbackdrop-filterborder-radiusbox-shadow
iOS Frostedrgba(255, 255, 255, 0.7)blur(20px) saturate(180%)20px0 10px 30px rgba(0, 0, 0, 0.1), inset 0 0 20px rgba(255, 255, 255, 0.35)
macOS Surfacergba(255, 255, 255, 0.4)blur(12px) saturate(150%)12px0 5px 20px rgba(0, 0, 0, 0.1), inset 0 0 12px rgba(255, 255, 255, 0.35)
Dark Glassrgba(31, 41, 55, 0.3)blur(16px) saturate(200%)16px0 8px 25px rgba(0, 0, 0, 0.1), inset 0 0 8px rgba(255, 255, 255, 0.35)

Every preset also writes border: 1px solid rgba(255, 255, 255, 0.3) and -webkit-backdrop-filter with the same value.

Frequently asked questions

Why is my backdrop-filter not working?
MDN: the effect shows only when the element, or its background, is transparent or partly transparent, so a Tint opacity of 1 gives a solid panel with nothing to see through. It also needs something behind the element to blur; a plain color looks the same blurred. Browsers that read neither spelling get the @supports not (...) fallback, which makes the tint 0.1 more opaque (0.5 becomes 0.6).
What are the Tailwind classes for glassmorphism?
For the starting glass: bg-[rgba(255,255,255,0.5)] backdrop-blur-[16px] backdrop-saturate-[180%] border border-[rgba(255,255,255,0.3)] rounded-[16px] shadow-[0_5px_20px_rgba(0,0,0,0.1)]. The Tailwind output gives them as an @apply rule for a .glass class and as a class list to put on the element.
What does Inner Glow do?
It adds a white glow along the inside edge, written into the same box-shadow as inset 0 0 (glow × 4)px rgba(255, 255, 255, 0.35): 2.5 gives inset 0 0 10px, and 0 leaves it out. It does not brighten the whole panel.
Can the glass be a color other than white?
Yes. Color sets the tint and Tint opacity its alpha, from 0 (clear glass) to 1 (solid): the Dark Glass preset writes rgba(31, 41, 55, 0.3). The border is white, 0 to 8 px wide at an opacity of 0 to 1 (1px at 0.3 to start; 2 px at 0.5 writes border: 2px solid rgba(255, 255, 255, 0.5)), and the shadow is black at 0.1.
Does the CSS set a text color?
No. The preview picks black or white text for the glass over the chosen background, an estimate that ignores the colored shapes behind it, but the exported CSS leaves the text color to your page. Check the contrast of your own text over your own background.

Network use

This tool loads a background photo from picsum.photos only when you select one of the photo backgrounds. Privacy policy

Related Tools

View all tools