Skip to content

Icon fonts vs SVG icons, and when a font still makes sense

A code icon, two angle brackets, on a keyline grid

Use SVG icons for new work. They render as crisp shapes at any size, keep showing when a user overrides fonts, can be more than one colour, and with a modern build tool only the icons you use reach the page. Icon fonts still make sense in two cases: when you want a variable icon font like Material Symbols, whose fill and weight you can animate from CSS, and when you maintain a site where adding a stylesheet is the only change you can make.

If you have an icon font today, there's no emergency. The problems below are real but mostly small, and you can move screen by screen.

Why products moved from icon fonts to SVG

GitHub's 2016 post Delivering Octicons with SVG is still the clearest account of the switch. Its engineers called icon fonts "a hack" and listed what went wrong: icons rendered poorly on standard-density screens, users who override fonts saw empty squares, the page waited on the font file, and every icon had to be drawn at one size.

Those reasons still hold, and they come from how fonts work. A browser treats an icon font as text: it hints and anti-aliases the glyphs like letters, aligns them to the line's baseline, and applies the user's font settings to them. That's ideal for letters and awkward for pictures.

Icon fonts vs SVG, side by side

Icon fontSVG icons
RenderingAnti-aliased as text; can blur or shift by a pixelDrawn as shapes at any size
Font overridesShow as boxes or wrong charactersKeep showing
ColoursOne colour per glyph (layered glyphs for two)Any number of colours, currentColor included
What loadsThe whole font, unless you subset itOnly the icons you import or inline
AccessibilityGlyphs can be read out as charactersHidden or labelled with standard attributes
Stylingcolor, font-size, and variable axes where the font has themcolor, size, stroke width, per-part styling
SetupOne stylesheet and a class nameA package, sprite or inline markup

Accessibility: the strongest reason to switch

Icon fonts map each icon to a character, usually in the Unicode Private Use Area. Screen readers may announce that character, skip it, or read out an unrelated symbol, depending on the reader and the font. The fix is to add aria-hidden="true" to every decorative icon and give meaningful ones a text alternative, which works but is easy to forget.

Users with dyslexia or low vision often replace a site's fonts with their own, through browser settings or extensions. With an icon font, every icon then turns into a box or a wrong character, and an icon-only button loses its only clue. SVG icons aren't affected by font settings at all.

Both kinds of icon need the same care beyond that: hidden when decorative, named when they're the only content of a button, and with enough contrast. Icon accessibility covers each case.

Performance: it depends on how you load them

An icon font is one file with every glyph in it, so a page that uses ten icons can still download hundreds. Font tools can subset a font to the icons you use, but few projects set that up. The font also has to load before icons appear, so slow connections see a gap or a flash of fallback characters.

SVG icons imported as components are bundled with your code, and tree-shaking leaves out the ones you don't import, so the cost grows with the icons you use. For pages that repeat hundreds of icons, a sprite keeps the markup small. SVG icons in React measures the options, including what each approach costs your bundle.

When an icon font is still the right call

Variable icon fonts. Google's Material Symbols font has axes for fill, weight, grade and optical size. You can fill an icon when it's selected, make it bolder in dark mode, or animate between states with font-variation-settings, all in CSS. SVG can't do that without separate drawings for each state.

No build step. On a CMS theme, a static marketing page or a legacy app where you can add a stylesheet but not a component library, a font with <i class="…"> tags is the least work. Font Awesome, Bootstrap Icons, Tabler Icons and Remix Icon all ship web fonts for this.

Prototypes. For a quick mockup, a font from a CDN is fast. Plan to replace it before the product ships.

If you keep an icon font, hide decorative icons with aria-hidden="true", label meaningful ones in visible or screen-reader text, and subset the font to the icons you use.

How to move from an icon font to SVG

  1. List the icons in use. Search your templates for the font's class prefix and collect the unique names. Most products use a few dozen.
  2. Pick the SVG source. If your font comes from a set that also ships SVG packages, like Font Awesome or Tabler, use the same set and only the delivery changes. If you're changing sets too, see Font Awesome alternatives.
  3. Add one icon component. Wrap the SVG in a component that takes a name and a size, sets aria-hidden by default and accepts a label. Replace <i> tags with it screen by screen.
  4. Check alignment. Font icons sit on the text baseline and SVGs sit in a box, so icons beside text may shift. Align them with flexbox and align-items: center rather than vertical-align tweaks.
  5. Remove the font. Once no template references it, delete the stylesheet and the font files, and check the page no longer requests them.

What we ship

Pikaicons are SVG first. You can copy each icon from the web app as SVG, React, Vue, Svelte, React Native or Solid, and the free set installs from npm as React components. We don't ship an icon font, for the reasons above.

The full library has 6,000+ icons in five styles from $99 once (pricing), and 900+ of them are free under MIT.

Frequently asked questions

Should I use icon fonts or SVG?

SVG for most products. SVG icons render as shapes rather than text, keep working when users override fonts, can be multicoloured, and only the icons you use need to load. Icon fonts make sense for variable fonts like Material Symbols, or where you can add a stylesheet but not a component library.

Are icon fonts bad for accessibility?

They need extra care. Screen readers may announce an icon font's characters, and users who replace a site's fonts see boxes instead of icons. Hide decorative font icons with aria-hidden="true" and give meaningful ones a text alternative, or use SVG, which font settings don't affect.

Are icon fonts dead?

No, but they're no longer the default. Font Awesome, Bootstrap Icons, Tabler Icons and Material Symbols still ship fonts, and Material Symbols' variable font does things SVG can't. Most new component libraries ship SVG components instead.

Are SVG icons faster than icon fonts?

Usually, when you load them as components or a sprite, because only the icons you use reach the page. An icon font downloads every glyph unless you subset it, and icons can't appear until the font has loaded.

Why do my font icons look blurry?

Browsers render icon fonts as text, so the glyphs are anti-aliased and aligned to the text baseline, which can put their edges between pixels. SVG icons drawn on a pixel grid render more crisply at their design size.

Try Pikaicons in your own UI

The quickest way to judge an icon set is to drop it into your own interface. The 900+ free icons are yours to copy and ship, and the full library has 6,000+ icons across five styles for one payment from $99.

Browse icons

Ash