font-smooth CSS property

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

The font-smooth CSS property controls the application of anti-aliasing when fonts are rendered.

Syntax

css
/* Keyword values */
font-smooth: auto;
font-smooth: never;
font-smooth: always;

/* <length> value */
font-smooth: 2em;

/* Global values */
font-smooth: inherit;
font-smooth: initial;
font-smooth: revert;
font-smooth: revert-layer;
font-smooth: unset;

Note: WebKit implements a similar property, but with different values: -webkit-font-smoothing. It only works on macOS.

  • auto - Let the browser decide (Uses subpixel anti-aliasing when available; this is the default)
  • none - Turn font smoothing off; display text with jagged sharp edges.
  • antialiased - Smooth the font on the level of the pixel, as opposed to the subpixel. Switching from subpixel rendering to anti-aliasing for light text on dark backgrounds makes it look lighter.
  • subpixel-antialiased - On most non-retina displays, this will give the sharpest text.

Note: Firefox implements a similar property, but with different values: -moz-osx-font-smoothing. It only works on macOS.

  • auto - Allow the browser to select an optimization for font smoothing, typically grayscale.
  • grayscale - Render text with grayscale anti-aliasing, as opposed to the subpixel. Switching from subpixel rendering to anti-aliasing for light text on dark backgrounds makes it look lighter.

Formal definition

Initial valueauto
Applies toall elements
Inheritedyes
Computed valueas specified
Animation typediscrete

Formal syntax

font-smooth = 
auto |
never |
always |
<absolute-size> |
<length>

<absolute-size> =
xx-small |
x-small |
small |
medium |
large |
x-large |
xx-large |
xxx-large

Examples

Basic usage example

The following example shows the Safari/Chromium and Firefox equivalents that turn on font-smoothing on macOS. In both cases the smoothed font should look slightly lighter in weight.

For those of you not on a macOS system, here is a screenshot (the live version appears later on):

Two texts examples one with the font-smooth property and another one without

HTML

html
<p>Without font smoothing</p>

<p class="smoothed">With font smoothing</p>

CSS

css
html {
  background-color: black;
  color: white;
  font-size: 3rem;
}

p {
  text-align: center;
}

.smoothed {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

Result

Specifications

Not part of any standard.

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
font-smooth
Non-standard
Chrome – Full support
Chrome 5 (Release date: 2010-05-25)
altname
altname Alternate name: -webkit-font-smoothing
Edge – Full support
Edge 79 (Release date: 2020-01-15)
altname
altname Alternate name: -webkit-font-smoothing
Firefox – Full support
Firefox 25 (Release date: 2013-10-29)
footnote , altname
altname Alternate name: -moz-osx-font-smoothing
footnote Only works on macOS.
Opera – Full support
Opera 15 (Release date: 2013-07-02)
altname
altname Alternate name: -webkit-font-smoothing
Safari – Full support
Safari 4 (Release date: 2009-06-08)
altname
altname Alternate name: -webkit-font-smoothing
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
altname
altname Alternate name: -webkit-font-smoothing
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
altname
altname Alternate name: -webkit-font-smoothing
Safari on iOS – Full support
Safari on iOS 3.2 (Release date: 2010-04-03)
altname
altname Alternate name: -webkit-font-smoothing
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
altname
altname Alternate name: -webkit-font-smoothing
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
altname
altname Alternate name: -webkit-font-smoothing
WebView on iOS – Full support
WebView on iOS 3.2 (Release date: 2010-04-03)
altname
altname Alternate name: -webkit-font-smoothing

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Non-standard. Check cross-browser support before using.
See implementation notes.
Uses a non-standard name

See also