LocalFirstTools.com — data tools that never leave your device
No upload — everything runs on your device

Base64 encode

Base64 (RFC 4648) maps every 3 input bytes to 4 ASCII characters — a fixed +33.3% size overhead before padding, plus up to two “=” characters at the end. This encoder first converts your text to UTF-8 bytes, so accents and emoji round-trip correctly instead of throwing the classic btoa “characters outside of the Latin1 range” error.

The 4-per-3 ratio is exact, and real inputs confirm it: encoding the raw bytes of all 26 documents in our sample corpus produced a median overhead of +33.5% (min +33.3%, max +34.1%) — the spread above 33.3% is entirely the “=” padding, which costs most on short inputs. A 3-byte input gains exactly 1 byte; a 300 KB file gains 100 KB.

When it goes wrong

Encoding cannot fail — every input has a Base64 form. If the output looks wrong at the other end, the receiver is usually decoding with the wrong variant: output containing “+” or “/” breaks URL contexts, which need Base64URL (the “-” and “_” alphabet) instead. If a legacy system rejects long lines, it expects MIME's 76-character line wrapping, which this tool does not add.

When to use this

Base64-encode text for HTTP Basic auth headers, data: URLs, or any channel that only carries ASCII safely. Remember it is an encoding, not encryption — anyone can decode it.

This page is a focused view of theBase64 Encode / Decode, which has the full set of options.

Frequently asked questions

Why does Base64 output end with = signs?

Base64 maps 3 input bytes to 4 output characters. When input length is not a multiple of 3, the output is padded with one or two = characters to keep the length a multiple of 4.

How much bigger is Base64 than the original?

Exactly 4 characters per 3 bytes: +33.3%, plus up to 2 bytes of padding. On our 26-document corpus the measured median was +33.5%.

Is Base64 encryption?

No. It is a reversible transport encoding with no key. Anything Base64-encoded should be treated as plainly readable.