Base64 Images: 33% Bigger, but Only 0.5% After Gzip (Test)

Base64 lets you put an image straight into HTML or CSS as a data URI, with no extra file to load. Everyone says Base64 is “33% bigger”, but does that still matter once the page is compressed by the server? We converted four images with our Image to Base64 tool and measured the size before and after gzip.

Test 1: how much bigger is Base64?

On 3 November 2026 we converted a 32 × 32 icon, a 200 × 60 logo, a 960 × 600 graphic and a 1080 × 1920 photo:

ImageFileAs Base64 data URIGrowth
Icon 32 × 32 PNG718 B982 B+36.8%
Logo 200 × 60 PNG3.3 KB4.4 KB+34.0%
Graphic 960 × 600 PNG256.4 KB341.9 KB+33.3%
Photo 1080 × 1920 JPG365.0 KB486.7 KB+33.3%

Small files grow a little more than 33% because the data:image/png;base64, prefix is a bigger share of a tiny file.

Test 2: after gzip

Web servers usually compress HTML and CSS with gzip or Brotli. We gzipped the original files and their Base64 text:

Imagegzip of the filegzip of the Base64Difference
Icon 32 × 32741 B768 B+3.6%
Graphic 960 × 600261,777 B263,009 B+0.5%
Photo 1080 × 1920359,259 B360,934 B+0.5%

Once compressed, Base64 cost only 0.5–3.6% more bytes. The famous 33% mostly disappears on a server with compression switched on.

So why not inline everything?

  • No separate caching. An inlined image is downloaded again every time the HTML or CSS changes, and it can't be shared between pages.
  • It delays the page. The browser must download the whole data URI before it finishes parsing the HTML or CSS around it, which hurts render time for large images.
  • No lazy loading or responsive sizes. loading="lazy" and srcset don't help an image that is already inside the HTML.

A practical rule

  1. Inline only tiny images, roughly under 2–4 KB: icons, small logos, CSS backgrounds and placeholders, and images in HTML emails.
  2. Keep photos and large graphics as files, compressed first with the Image Compressor and served as WebP where possible.
  3. Prefer SVG for icons when you have it: it is usually smaller than a Base64 PNG and stays sharp.
  4. Need Base64 for text rather than images? Use the Base64 encoder and decoder.

Frequently asked questions

How much bigger is a Base64 image?

About 33% larger before compression; in our test 34–37% for small files because of the data URI prefix. After gzip the difference was only 0.5–3.6%.

Is Base64 good for website performance?

For tiny images it can save a request. For large images it usually hurts, because the image can't be cached separately and delays parsing.

How do I convert an image to Base64?

Drop the image on our Image to Base64 tool and copy the format you need: data URI, plain Base64, an HTML <img> tag or a CSS background. The image is not uploaded.

Can I use Base64 images in email?

Many email clients block or strip data URIs, so test first. Hosted images or attached (CID) images are more reliable in email.