Google Font Embed Generator
Generate the <link> or @import embed code for any font.
HTML <link> tag (recommended)
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400&display=swap">
CSS @import
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400&display=swap');
FAQ
Link tag or @import — which is faster? +
A <link> tag in your document <head> is generally faster, since the browser can discover and fetch the font earlier in the page load than with a CSS @import.
Should I load every weight of a font? +
No — only request the specific weights and styles you actually use on the page, to keep load times fast.