Skip to main content
CalcChef

CSS Font Preview

Preview a standard font stack or any Google Fonts family at 8 to 120 px with weight, line height and letter spacing, and copy the CSS and @import. How it works

Use the CSS Font Preview

Shown under the first font with the same size, weight and spacing.

Text Transform
Font Style
Preview Text
Preview Background

The quick brown fox jumps over the lazy dog.

CSS
font-family: sans-serif;
font-size: 24px;
font-weight: 400;
line-height: 1.5;
letter-spacing: 0em;
text-transform: none;

To see two Google families together, try the Font Pair Generator.

Font previews load fonts from Google Fonts (fonts.googleapis.com and fonts.gstatic.com); the font name you type is sent to Google Fonts.

About the CSS Font Preview

Type a Google Fonts family such as Roboto, or pick one of 16 standard font stacks, and your sample text is drawn in it at 8 to 120 px, weight 100 to 900, line height 1 to 3 and letter spacing -0.1 to 0.5 em. The CSS starts as font-family: sans-serif; font-size: 24px; font-weight: 400; line-height: 1.5; letter-spacing: 0em; text-transform: none; and each control changes one line.

The Google Fonts request for a family name

Name typedFirst request (weights 100 to 900)If Google refuses it (regular weight only)
Robotohttps://fonts.googleapis.com/css2?family=Roboto:[email protected]&display=swaphttps://fonts.googleapis.com/css2?family=Roboto&display=swap
Noto Sanshttps://fonts.googleapis.com/css2?family=Noto+Sans:[email protected]&display=swaphttps://fonts.googleapis.com/css2?family=Noto+Sans&display=swap
Roboto Monohttps://fonts.googleapis.com/css2?family=Roboto+Mono:[email protected]&display=swaphttps://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap
Source Sans 3https://fonts.googleapis.com/css2?family=Source+Sans+3:[email protected]&display=swaphttps://fonts.googleapis.com/css2?family=Source+Sans+3&display=swap

Spaces in the name are written as +.

What the family and weight boxes accept

TypedResult
Family: " Open Sans " (extra spaces)Requested as Open Sans
Family: Roboto & CoUse only letters, digits and spaces, such as Noto Sans or Roboto Mono.
Family: 61 charactersUse at most 60 characters.
Family: (empty)Type a Google Fonts family name, such as Roboto.
Weight: 400Applied as 400
Weight: 950Enter a weight from 100 to 900.
Weight: 700.5Enter a whole number from 100 to 900.
Weight: (empty)Enter a whole number from 100 to 900.

A refused weight is not clamped: the last valid weight stays.

How to use this tool

  1. Pick a standard font from the list, or type a Google Fonts family and wait a moment or press Load.
  2. Set the size, weight, line height and letter spacing, then a text transform and italic if you want them.
  3. Edit the sample text or pick Pangram, Letters + Digits or Symbols, and switch the specimen between a white and a dark page.
  4. To compare, pick a standard stack under Compare with: it is drawn under your font with the same size, weight and spacing.
  5. Copy the CSS. For a Google family, press Show Import under it and copy the snippet that starts with @import.

Frequently asked questions

How do I preview a Google Font before using it?
Type the family name as Google Fonts spells it, such as Roboto or Noto Sans. A name may hold letters, digits and single spaces, up to 60 characters. The tool loads the family from Google Fonts and applies it only once the stylesheet and the font file have both loaded. If Google does not serve the name, the status says so and the preview keeps the font it was showing.
How do I add a Google Font to my CSS?
After a Google family is applied, press Show Import in the Google Import CSS block. For Roboto it reads @import url('https://fonts.googleapis.com/css2?family=Roboto:[email protected]&display=swap'); followed by the font-family rules. Put the @import at the very top of your stylesheet, or use the same address in a link tag in the page head, which starts the download sooner.
Why does it say the font loaded in regular weight only?
Google’s CSS API takes a weight range only inside the family’s own range, and a family with fewer weights can refuse the 100 to 900 request. The tool then asks again for the plain family, shows it in regular weight and says so; the browser approximates other weights. The output keeps the plain address.
What font weights can I preview?
Whole numbers from 100 to 900, by the slider in steps of 100 or by typing a value such as 450. A value like 950 or an empty box is refused with a message and the last valid weight stays. Whether 450 looks different from 400 depends on the font.
Why does a standard font look different on another computer?
The 16 standard entries are font names your device must have installed, so Garamond or Bookman may be drawn in another font on a system without them. The tool cannot detect that fallback, so test on the devices you care about.
What does this tool send to Google?
The family name you type, as part of the stylesheet address, and your IP address, which any browser request carries. Your sample text is not sent.

Network use

Nothing is requested until you type a font name; the tool then loads that font from Google Fonts (fonts.googleapis.com and fonts.gstatic.com), which receives the name you typed and sees your IP address. Privacy policy

Related Tools

View all tools