Encoding Size Calculator (Base64, Base32, Base58, Hex)
Know exactly how big your data will be after encoding, so it fits in a URL, a QR code, a database column, a header or an API limit.
Runs in your browser. Your files never leave your device. See how to check
…
How to do it
- 1Choose what to measure
Bytes, text or hex.
- 2Enter the data
Or a byte count.
- 3Read the table
Every encoding's length.
- 4Compare overheads
Percent larger than the input.
- 5Set a limit
See what fits.
- 6Pick the encoding
Best for your channel.
About this tool
Binary data often has to travel as text: images embedded in HTML as data URIs, keys and tokens in JSON and HTTP headers, attachments in email, identifiers in URLs and payloads in QR codes. Each encoding makes the data bigger by a different amount, and running into a limit, such as a 255-character database column, an 8 KB header limit or a QR code's capacity, is a common source of bugs. This calculator gives the exact output length for twelve encodings at once: hex, padded and unpadded Base32, Base45 used in QR-code health certificates, Base58 used for Bitcoin addresses, padded Base64, unpadded Base64 and Base64url as used in JWTs, Base64 with MIME line breaks, Ascii85, uuencode, quoted-printable and URL percent-encoding. Enter a byte count for the fixed-ratio encodings, or paste text (measured in UTF-8 bytes) or hex to get exact results for the encodings whose length depends on the data, such as Base58, quoted-printable and URL encoding. It also works backwards, telling you how many bytes fit within a character limit.
Overheads at a glance
- Hex: 100% larger, 2 characters per byte. - Base32: 60% larger, 8 characters per 5 bytes. - Base64: 33% larger, 4 characters per 3 bytes, padded to a multiple of 4. - Ascii85: 25% larger, 5 characters per 4 bytes. - Base45: 50% larger, 3 characters per 2 bytes, chosen because QR codes store its alphabet efficiently. - Base58: about 37% larger, but the exact length depends on the value, and each leading zero byte becomes a 1.
Padding and variants
Standard Base64 pads output with = to a multiple of four characters. Base64url replaces + and / with - and _ and usually drops the padding, which is why JWT segments have no = signs. MIME email adds a line break every 76 characters, adding two bytes per line.
Text is measured in bytes
Encodings work on bytes, not characters. In UTF-8, English letters take one byte, accented letters two, most Asian scripts three and emoji four, so a short message with emoji can encode to much more than you expect. The calculator converts your text to UTF-8 first.
Practical limits to keep in mind
- URLs: keep under about 2,000 characters for compatibility. - HTTP headers: many servers limit each header to 8 KB. - QR codes: up to 4,296 alphanumeric characters or 2,953 bytes at the lowest error correction. - Data URIs: fine for small icons, wasteful for large images.
Limits
Quoted-printable and URL encoding lengths are exact for the data you paste; for a plain byte count they cannot be predicted. This tool measures sizes; to convert data, use an encoder.
Worked example
1,000 bytes become 2,000 hex characters, 1,600 in Base32, 1,336 in Base64 and 1,334 in unpadded Base64url, while the text Hello (5 bytes) becomes 8 Base64 characters, 7 in Base58 and 8 in Base45.
Quick facts
- Category: Developer & Data
- Works in your browser, no sign-up, no upload.
- Your input stays on your device.
- Available in English.
- Content last reviewed:
- Official source: RFC 4648 (Base16, Base32, Base64 data encodings)
Frequently asked questions
How much bigger does Base64 make data?
About 33%: every 3 bytes become 4 characters, padded to a multiple of 4.
Why does my JWT have no = signs?
JWTs use unpadded Base64url.
Why is Base58 length variable?
It encodes the data as one large number, so the length depends on its value.
Does it count characters or bytes?
Text is converted to UTF-8 bytes first, which is what encoders use.
Can it tell me what fits in a limit?
Yes. Enter a character limit to see the largest input that fits.
Is my data uploaded?
No. Sizes are calculated in your browser.
