How to use Google Fonts on a website

The quickest way to use a Google Font is one line of HTML or CSS. Every font card on Fonties has a Copy CSS button that gives you the snippet.

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">

Then: font-family: 'Inter', sans-serif;

Option 2: @import in CSS

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

Performance tips

  • Load only the weights you use (each adds a file).
  • Keep display=swap so text shows immediately.
  • Use variable fonts when you need many weights.
  • Consider self-hosting (download the files and serve them from your own domain) for speed and to avoid third-party requests: some EU organizations self-host for privacy compliance.

Using fonts in other tools

  • WordPress: many themes let you pick Google Fonts in the Customizer; otherwise add the link tag via your theme or a header plugin.
  • Shopify: the theme editor’s typography settings include a large font library; custom fonts need theme code.
  • Webflow, Squarespace, Wix: Google Fonts are built into the font pickers.

Fallback fonts

Always end a font stack with a generic family (font-family: 'Inter', system-ui, sans-serif;) so text still renders if the web font fails to load.

Frequently asked questions

Are Google Fonts free for commercial websites?

Yes: they’re open-licensed. See font licensing.

More font help