DEV Community

BM lm
BM lm

Posted on

Google Fonts vs self-hosting: the decision matrix nobody writes down

The default is copying a Google Fonts <link> tag and moving on. Sometimes that is right. Here is the actual decision matrix.

Google Fonts CDN: when it wins

  • Cache hit probability. fonts.gstatic.com is shared across millions of sites. If your visitor already visited ANY site using Inter via Google, it's cached. Self-hosted Inter on your site has a cold cache for every first visit.
  • Zero maintenance. Subsets, unicode-range splitting, and version updates are handled for you.
  • Prototypes and content sites where a 50-100ms font fetch is irrelevant.

Self-hosting: when it wins

  • GDPR. German courts (the 2022 Munich ruling) have held that loading Google Fonts from Google's CDN transfers IP data without consent. EU-audience sites increasingly self-host for compliance alone.
  • Subsetting control. You ship only the glyphs you use (pyftsubset or tools like next/font handle this automatically).
  • Reliability. Your font availability is coupled to your infrastructure only.
  • The third-party tax. Every external origin adds DNS + TLS setup to the critical path.

The hybrid that usually wins

Self-host + preload the primary weight:

<link rel="preload" href="/fonts/inter-400.woff2" as="font" type="font/woff2" crossorigin>
Enter fullscreen mode Exit fullscreen mode

plus font-display: swap with tuned fallback metrics. You lose the shared cache, gain compliance and control - and a properly subset woff2 is often 15-30KB, smaller than the multi-range split Google serves.

The audit step

Whatever you choose, verify what actually renders in production: font stacks with fallbacks mean substitutions happen silently when files 404 or licenses lapse. Screenshot and identify on-device - Typeye names the rendered typeface from a screenshot entirely locally, so you can audit production pages without uploading anything.

The one-line answer

EU audience or performance-critical app: self-host. Prototype or content blog: Google Fonts CDN is fine. Anything in between: self-host anyway, it's 20 minutes of work and one less external dependency.

Top comments (0)