Inlining icons as SVG is the default now, and the cost of the default is rarely measured, because it does not show up where people look. There is no network request to see in the Network tab. Nothing appears in the JavaScript bundle. It hides inside the HTML, where nobody is counting.
So I counted. Once in the repository, once in the bytes the live site actually sends.
In the repository
lucide-react, imported in the ordinary way:
- 60 files import from
lucide-react - 81 distinct icons between them
- 197 import entries in total
- 39 of those 81 icons are imported by exactly one file
The most imported icon in the product is Loader2, in 13 files. Second is CheckCircle2 at 11, then Clock at 9. The most used icon in a product is almost always a spinner, and there is something clarifying about seeing that stated as a number: the single most reused piece of visual vocabulary we have is "wait".
The 39 icons used once are the long tail you would expect, and they are not worth consolidating. Tree shaking means an icon imported once is one function in one chunk, and the cost of standardising it away is a worse label on a button.
On the live homepage
Here is the part that is only visible from outside. Fetch the page and count:
curl -s https://pub-trivia.app/ | grep -o '<svg' | wc -l 48 <svg> elements, in a 170,427 byte HTML document. Extracting every one of them and adding up the bytes: 31,623, which is 18.6 per cent of the page. Almost one byte in five of our homepage is SVG markup.
That number is not what it looks like, though, because of what the 48 split into:
| count | bytes | share of the SVG | |
|---|---|---|---|
| lucide icons | 43 | 16,129 | 51% |
| the mascot | 5 | 15,494 | 49% |
43 icons averaging 375 bytes each, and five copies of a hand-drawn pint glass averaging 3,098. The mascot is a viewBox="0 0 120 120" drawing with a clipPath, which is to say it is a real illustration rather than a 24 by 24 line icon, and it appears five times on the page in different moods.
The 43 icons are 14 distinct icons in 15 distinct class strings, one icon appearing at two different sizes. Grouped by that full class string, the distribution is the usual power law:
22 lucide-check h-3.5 w-3.5 text-muted-foreground flex-shrink-0 4 lucide-arrow-right text-muted-foreground mt-1 h-4 w-4 shrink-0 2 lucide-settings2 lucide-settings-2 h-5 w-5 2 lucide-qr-code h-4 w-4 text-foreground 2 lucide-zap h-4 w-4 text-foreground 2 lucide-x h-3.5 w-3.5 text-muted-foreground/30 flex-shrink-0 1 lucide-chevron-down ... 1 lucide-users h-[calc(3.4*var(--u))] ... (and seven more, once each) One icon, the 240 byte check mark, accounts for 22 of the 48 SVG elements on the page: it is the tick in front of every line of every feature list. The 22nd copy of a path is identical to the first in every byte except the Tailwind classes around it.
Two incidental things in that list. lucide-settings2 lucide-settings-2 is two class names for one icon, which is how the library handles a rename without breaking anyone's CSS. And h-[calc(3.4*var(--u))] is an icon sized in the big screen's own proportional unit, which is a nice sign that the icon component does not care what unit you hand it.
What it costs after compression
Raw bytes are the wrong unit for anything that travels over HTTP, and 22 identical paths are the best case a compressor will ever see. So I stripped every <svg> element out of the page and compressed both versions:
| raw | gzip | brotli -q 11 | |
|---|---|---|---|
| homepage as served | 170,427 | 20,928 | 14,400 |
| the same page with all 48 SVGs deleted | 138,804 | 17,693 | 12,810 |
| difference | 31,623 | 3,235 | 1,590 |
So 31.6 KB of SVG markup is 1.6 KB on the wire. 18.6 per cent of the raw document is 11 per cent of the compressed one, and the 22 check marks are effectively free after the first.
Which means the answer to "is inlining icons expensive" is: not in transfer. It is not nothing either. Those 48 elements are real DOM nodes with real paths that the browser parses, builds and may need to rasterise, and the mascots in particular are not icon-shaped work.
One detail stops the mascots compressing as well as the check marks do. Each instance's clip path needs a unique id, which comes from React's useId:
froth-glass-_R_1jiinmlb_ froth-glass-_R_2cbbl3inmlb_ froth-glass-_R_2cbbl4inmlb_ froth-glass-_R_j5inmlb_ froth-glass-_R_139inmlb_ Five near-identical 3 KB drawings whose only differences are those ids and the pose. If I wanted that 15 KB back, the move is one <svg> of <symbol> definitions plus five <use> references, which would be about 3 KB raw instead of 15. The reason we have not done it is that each instance animates independently, and <use> makes the internals of each copy harder to reach from CSS. That is a trade, not an oversight, and now it is a trade with a number on it.
A content page is five icons, three of them invisible
The homepage is the extreme. A page of prose is the floor, and it is remarkably bare. Every page under /guides ships exactly five SVG elements, 1,778 bytes:
294B lucide-chevron-down the Resources dropdown in the header 305B lucide-chevron-right the breadcrumb separator 393B lucide-arrow-right related link 393B lucide-arrow-right related link 393B lucide-arrow-right related link Three of the five are opacity-0 transition-opacity group-hover:opacity-60: arrows that exist only to appear when you hover a related link. That is 1,179 bytes of SVG for a hover state, which I mention because it is the kind of thing a sensible audit flags and a sensible developer keeps. It is 72 bytes after compression and it makes the links feel like links.
The count being identical across every page in a cluster is also the useful signal here. /guides and /compare both ship exactly 5 SVGs and exactly 1,778 bytes of them, because the chrome is shared and the page body is prose. Any content page that reports a different number is a page doing something unusual, and that is worth knowing without reading it.
Check it yourself
All of this is one curl away, which is the main reason to measure your own:
# how many icons does a page inline? curl -s https://pub-trivia.app/ | grep -o '<svg' | wc -l # 48 curl -s https://pub-trivia.app/guides | grep -o '<svg' | wc -l # 5 # what do they weigh, raw and compressed? curl -s https://pub-trivia.app/ | wc -c curl -s https://pub-trivia.app/ | brotli -c -q 11 | wc -c Then look at the pages themselves: the mascot and the 22 check marks are on pub-trivia.app, and the three invisible arrows are at the bottom of any guide, for example pub-trivia.app/guides/how-to-host-a-pub-quiz, where they fade in as you hover each related link. The whole set of icons on those pages costs zero network requests, which is the thing inlining actually bought, and 1.6 KB, which is what it cost.
If you want to see the same icon vocabulary doing work rather than sitting in a list, the free tools at pub-trivia.app/tools run entirely in the browser, so you can watch the Network tab stay empty while they draw.

