Developer and Text Tools

How Much Bigger Does Base64 Make Data? Encoding Sizes Explained

Why Base64 adds 33%, hex doubles data and Base58 varies, how padding and line breaks change lengths, and how to fit data into URLs and QR codes.

Saizul Amin
Saizul Amin30 Oct 2026 · 3 min read
How Much Bigger Does Base64 Make Data? Encoding Sizes Explained

How Much Bigger Does Base64 Make Data? Encoding Sizes Explained

Binary data such as images, keys, signatures and compressed payloads often has to pass through channels built for text: JSON, URLs, HTTP headers, email and QR codes. Text encodings make that possible, at the cost of size. Knowing exactly how much bigger the data becomes helps you avoid hitting limits. The free Encoding Size Calculator gives exact lengths for twelve encodings.

Why encoding adds size

A byte can hold 256 values, but text channels are safe only for a smaller set of characters. An encoding maps groups of bytes to groups of safe characters. The fewer characters in the alphabet, the more characters you need:

  • Hex uses 16 symbols, so each byte becomes 2 characters: 100% overhead.
  • Base32 uses 32 symbols: every 5 bytes become 8 characters, 60% overhead.
  • Base64 uses 64 symbols: every 3 bytes become 4 characters, about 33% overhead.
  • Ascii85 uses 85 symbols: every 4 bytes become 5 characters, 25% overhead.

Padding, URLs and line breaks

Standard Base64 pads its output with equals signs so the length is a multiple of four. Base64url swaps the + and / characters for - and _, which are safe in URLs and file names, and usually drops the padding. That is why the three parts of a JSON Web Token never contain = signs. Email uses MIME Base64 with a line break every 76 characters, which adds two more bytes per line.

Encodings with variable length

Some encodings depend on the content, not just the size:

  • Base58, used for Bitcoin addresses and many short IDs, treats the data as one large number. Its length varies slightly with the value, and each leading zero byte becomes a "1".
  • Quoted-printable, used in email, leaves plain ASCII text almost unchanged but turns every other byte into three characters.
  • URL encoding leaves letters and digits as they are and turns everything else into a percent sign and two hex digits.

For these, paste your actual text or hex to get the exact size.

Base45 and QR codes

QR codes have an efficient alphanumeric mode that stores 45 particular characters very compactly. Base45 was designed to use exactly that set, so data encoded in Base45 takes less space in a QR code than Base64, even though the text is longer. The EU Digital COVID Certificate used this trick.

Text is bytes first

Encoders work on bytes, not characters. In UTF-8, an English letter is one byte, an accented letter two, most Chinese, Japanese and Korean characters three and an emoji four. A short message with a few emoji can therefore encode to far more characters than you might guess. The calculator measures text in UTF-8 bytes first.

Fitting within limits

Common limits include about 2,000 characters for URLs that must work everywhere, 8 KB per HTTP header on many servers and up to 2,953 bytes in the largest QR codes. Enter a character limit and the calculator tells you the largest input that fits in Base64, hex and Base32.

Images as data URIs

Embedding a small icon as a Base64 data URI saves a network request, but the image becomes a third larger and cannot be cached separately. For anything above a few kilobytes, a normal image file is usually faster. The same trade-off applies to fonts and other assets inlined in CSS.

Quick reference

One kilobyte of data becomes about 1.33 KB in Base64, 1.6 KB in Base32 and 2 KB in hex. One megabyte becomes about 1.33 MB in Base64.

Step by step

  1. Choose a byte count, text or hex input.
  2. Enter the data or size.
  3. Read the length for every encoding.
  4. Compare overheads.
  5. Enter a limit to see how much data fits.

Privacy

Sizes are calculated in your browser and your data is not uploaded.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages