Base64 Encoder / Decoder

Encode text or files to Base64, or decode Base64 back to text.

Variant:
Plain Text
Base64 Output

How It Works

Base64 encodes binary or text data as a string of ASCII characters using 64 printable symbols (A–Z, a–z, 0–9, +, /). It is commonly used to embed binary data in JSON, HTML, CSS (data: URLs), and email payloads. Each 3 bytes of input become 4 characters of output — approximately 33% overhead.

Base64URL is a URL-safe variant that replaces + with - and / with _, and omits = padding. It is used in JWTs, URL parameters, and filenames where standard Base64 characters would need percent-encoding.

This tool uses the browser's built-in btoa/atob APIs and supports full Unicode text. Files are encoded in chunks to handle large inputs without crashing.

Frequently Asked Questions

What is Base64 encoding used for?

Base64 encodes binary data as printable ASCII text so it can be safely transmitted in contexts that only handle text, such as email (MIME), JSON, HTML data: URLs, and HTTP headers. It is not encryption — it is purely a text-safe encoding.

How much does Base64 increase the size of data?

Approximately 33% overhead. Every 3 bytes of input become 4 Base64 characters. A 1 MB file encodes to roughly 1.37 MB of Base64 text.

What is the difference between Base64 and Base64URL?

Standard Base64 uses + and / characters which have special meaning in URLs. Base64URL replaces + with - and / with _, and omits = padding, making the output safe for URL parameters, filenames, and JWTs without percent-encoding.

How do I decode a Base64 string?

Paste the Base64 string into the input field and select Decode. If the string ends with = signs (padding), that is standard Base64. If it uses - and _ instead of + and /, switch to Base64URL mode.