internettoolbox
← Back to Tools

Base64 Encoder / Decoder

How it works

Type or paste text into the input area and click Encode to convert it to Base64, or paste a Base64 string and click Decode to get the original text back. Full UTF-8 is supported, so accented characters, CJK text and emoji round-trip without losing information.

Base64 represents three bytes of input as four ASCII characters drawn from A–Z, a–z, 0–9, + and /. That makes it 33% larger than the original binary but completely safe to embed in places that expect text: email bodies, JSON strings, HTTP headers, URLs (with the URL-safe variant), and PNG/SVG data URIs. When the input length is not a multiple of three bytes, one or two = signs are added as padding so decoders know where the data ends.

When the tool encodes, it first converts your text to UTF-8 bytes (via TextEncoder) and then Base64-encodes those bytes. When it decodes, it reverses the process: first decode the Base64 to raw bytes, then interpret those bytes as UTF-8. That order is what allows full Unicode to round-trip. If you paste a Base64 string that does not decode to valid UTF-8, say the Base64 of a random binary blob, the tool still shows you the bytes but marks them as binary rather than guessing at an encoding.

Typical uses: embedding a small image directly in a stylesheet (background-image: url(data:image/png;base64,…)), pasting a JWT or OAuth token for inspection (the JWT Decoder on this site splits one into header and payload), and moving a tiny binary file through a text-only channel like an email.

Frequently Asked Questions

What is Base64?

Base64 is a binary-to-text encoding that represents every 3 bytes of input with 4 ASCII characters from A–Z, a–z, 0–9, +, and /. It was standardised in RFC 2045 for MIME email; today you see it wherever data has to survive a text-only channel: JSON APIs, URLs, data URIs, PEM-encoded certificates and JWT tokens.

Does it support Unicode?

Yes. The tool first UTF-8-encodes your text to raw bytes (via the browser's TextEncoder), then Base64-encodes those bytes, and does the reverse when decoding. That means accented characters (àéü), CJK (你好), emoji (🚀) and every other Unicode code point round-trip perfectly.

Why is Base64 output bigger than the input?

Because Base64 packs every 3 bytes of input into 4 ASCII characters, so the encoded output is always ~33% larger than the original. That overhead is the price of being safe inside contexts that would break on arbitrary bytes (emails, URLs, JSON). It is not a compression format: use gzip, brotli or zstd if you need smaller.

What do the = signs at the end mean?

They are padding. Base64 works on blocks of 3 bytes, so when the input length is not a multiple of 3, one or two = characters are added to make every encoded value a multiple of 4 characters long. Decoders use the count of = signs to work out the original length.

What is the difference between Base64 and Base64URL?

Base64URL replaces + with - and / with _, and usually drops the trailing = padding. It exists for URLs and filenames, where +, / and = already mean something else. Standard Base64 is what you want for email and JSON; Base64URL is what JWTs use. This tool encodes and decodes standard Base64: to get the URL-safe form, replace + with - and / with _ and drop the trailing = padding.

Is Base64 a form of encryption?

No, and it is worth repeating. Base64 is an encoding, not a cipher. Anyone can decode it in one line in every language on earth. Treat Base64 content as if it were plain text and never rely on it to hide a secret.

Tool switcher

Search and jump to any tool