Base64 Encoder / Decoder

Encodeer tekst naar Base64 of decodeer Base64 terug naar leesbare tekst, met een kopieerknop voor gebruik in code, e‑mails en API‑verzoeken.

What Base64 is for

Base64 turns arbitrary bytes into plain ASCII text using 64 printable characters, which is why it shows up in email attachments, data URLs embedded in CSS/HTML, and API payloads. It is an encoding, not encryption - anyone can decode it back instantly, so it should never be used to protect secrets.

Why Base64 exists in the first place

Many older systems and text-based protocols (like email) were only designed to reliably carry plain printable text, not arbitrary binary data - Base64 solves that by representing any byte sequence using only 64 safe, printable characters, which is why formats built around moving binary data through text-only channels (email attachments, data URLs, many API payloads) rely on it.

Why Base64 provides zero confidentiality despite looking like scrambled text

Encoding and encryption solve different problems: encoding (like Base64) transforms data into a different representation using a fixed, publicly known rule with no secret key involved, while encryption requires a key to reverse. Anyone - a person or a program - can decode Base64 back to its original form instantly with no special knowledge required, which is exactly why it must never be used as a way to hide or protect sensitive information.

Why encoding text first converts it to UTF-8 bytes

Base64 only operates on raw bytes, and a character like an emoji or an accented letter is represented by more than one byte in UTF-8 - converting text to its UTF-8 byte representation before encoding (and reversing that conversion after decoding) is what makes multi-byte characters round-trip correctly rather than coming out garbled.

Where you will run into Base64 in everyday work

Beyond email attachments, Base64 appears in HTTP Basic Authentication headers, in data URLs that embed small files straight into HTML or CSS, in configuration files that need to carry certificates or keys as plain text, and in the header and payload segments of JSON Web Tokens. Recognising the pattern - a long run of letters, digits, plus and slash characters, often ending in one or two equals signs - makes it much easier to tell what a mysterious string in a log file or API response actually is.

What the equals signs at the end mean

Base64 takes three bytes of input and writes them as four characters. When the input length is not an exact multiple of three, the output is padded with one or two equals signs so the length stays a multiple of four. The padding carries no data of its own - it simply tells a decoder how many bytes the final group really contains - which is why two strings that look slightly different at the very end can still decode to nearly identical content.

URL-safe Base64 and why decoding sometimes fails

Standard Base64 uses plus and slash characters, which have special meaning inside URLs, so a URL-safe variant swaps them for a hyphen and an underscore and often drops the padding. JSON Web Tokens use that variant. If you paste such a string here and see the invalid Base64 message, replace the hyphens with plus signs, the underscores with slashes, add equals signs until the length is a multiple of four, and try again.

Veelgestelde vragen

Is Base64 a form of encryption?

No. It is a reversible encoding with no secret key, so it provides no confidentiality at all.

Why does encoding handle emoji and accented letters specially?

Base64 works on bytes, and this tool first converts text to UTF-8 bytes so multi-byte characters like emoji and accented letters round-trip correctly.

Why was Base64 created in the first place?

Many older text-based systems, like email, could only reliably carry plain printable characters, not arbitrary binary data - Base64 represents any byte sequence using safe, printable characters to get around that limitation.

If I decode something and get garbled text, what went wrong?

The input usually wasn't valid Base64 to begin with, or wasn't encoded as UTF-8 text originally - double-check you're decoding a string that was actually produced by Base64-encoding text, not arbitrary binary data.

Can I use this to encode an image file instead of text?

This tool is built for encoding and decoding text. For encoding an image into a Base64 data URL, use the dedicated Image to Base64 tool instead.

What do the equals signs at the end of a Base64 string mean?

They are padding. Base64 writes three bytes as four characters, so when the input is not a multiple of three bytes the output is padded with one or two equals signs to keep its length a multiple of four.

Why does a string from a JWT fail to decode here?

JSON Web Tokens use the URL-safe Base64 variant, with hyphens and underscores instead of plus and slash and usually no padding. Swap those characters back and add equals signs for padding, then the string will decode as standard Base64.

Meer in Converters & Utilities