Base64 Encoder / Decoder

Free Base64 encoder and decoder with full UTF-8 support and an optional URL-safe alphabet, running entirely in your browser.

Base64

Worked example

The text Hello, World! encodes to SGVsbG8sIFdvcmxkIQ==. Decoding that string returns the original text exactly โ€” Base64 is lossless in both directions.

Frequently asked questions

What is Base64 encoding for?

Base64 represents arbitrary binary data using only 64 printable ASCII characters, so it can be safely embedded in places designed for plain text โ€” email attachments, JSON fields, URLs, or data: URIs โ€” that would otherwise choke on raw binary bytes.

Is Base64 a form of encryption?

No โ€” it's an encoding, not encryption. Anyone can decode Base64 back to the original data with no key or password needed; it provides no confidentiality at all. Never use it to "hide" sensitive data.

Why is the encoded output longer than the original text?

Base64 packs every 3 bytes of input into 4 output characters, so encoded output is roughly 33% larger than the original โ€” the price of representing arbitrary binary data using only a 64-character alphabet.

What is the difference between standard and URL-safe Base64?

Standard Base64 uses + and / in its alphabet and pads the output with = signs โ€” both of which have special meaning in a URL, so they'd need extra encoding if used there. URL-safe Base64 swaps + and / for - and _, and typically omits the padding, so the result can go directly into a URL or filename without further escaping. This is the variant used inside JWTs.