Compyrix logo

Base64 Encoder & Decoder

Encode and decode Base64 strings instantly.

Base64 is a binary-to-text encoding scheme that represents arbitrary binary data using only 64 printable ASCII characters (A-Z, a-z, 0-9, +, /, and = for padding). It is widely used in email attachments, data URIs, JSON payloads containing binary data, HTTP Basic Authentication credentials, and CSS image inlining.

Our free Base64 Encoder & Decoder supports both directions: encode plain text to Base64, and decode Base64 back to text. The encoder uses UTF-8 to represent Unicode characters, so emojis, accented letters, CJK ideographs, and non-Latin scripts are handled correctly.

Simply type or paste your text into the corresponding box. The Encode button converts plain text → Base64. The Decode button converts Base64 → plain text. If invalid Base64 is entered during decoding, a clear error message is shown explaining the problem rather than producing garbled output.

Privacy note: All encoding and decoding is done in your browser. The content you encode or decode is never transmitted anywhere. This means you can safely process API keys, auth tokens, and other sensitive strings without exposure. For encoding files (images, PDFs) to Base64 data URIs, a future image tool will support this use case.

Frequently Asked Questions

Why is Base64 needed instead of sending raw bytes?
Many legacy systems and text-based protocols (SMTP email, early HTTP headers, JSON strings) are not 8-bit clean and may corrupt, truncate, or misinterpret non-ASCII bytes. Base64 guarantees safe transmission through any text channel at the cost of about 33% size overhead (3 bytes become 4 characters).
What are the = characters at the end?
The equals sign is padding. Base64 processes input in groups of 3 bytes (24 bits), producing 4 characters. If the input is not a multiple of 3, the final group is right-padded with zero bits and = marks how many padding bytes were added (one = for 1 missing byte, two = for 2 missing bytes).
What is the difference between Base64, Base64URL, and Base32?
Standard Base64 uses + and /, which conflict with URLs and filenames. Base64URL replaces + with - and / with _ and often omits padding. Base32 uses only uppercase letters and digits (32 characters total), is case-insensitive, but has ~60% size overhead. Our tool uses standard Base64.
Can Base64 be used as encryption?
No! Base64 is encoding, not encryption. Anyone can decode Base64 back to the original data instantly. It provides zero confidentiality. Never store passwords or secrets as Base64 — use a password hash (bcrypt/Argon2) for storage and a cipher (AES) for transport confidentiality.

Related Tools