GrowthGPT
GrowthGPT
AI community platform for modern work

Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 strings with full UTF-8 support.

Input

Paste plain text to encode, or a Base64 string to decode.

Output

Result will appear here.

Click Encode or Decode to see the result here.

Stats

0 B
Input size
0 B
Output size
N/A
Output / input ratio

About this tool

  • Supports full UTF-8 including emoji and non-Latin characters.
  • All processing happens in your browser. No data is sent to any server.
  • Base64 encoding increases data size by approximately 33%.

What Is Base64 Encoding

Base64 is a binary-to-text encoding scheme that converts binary data into a string of ASCII characters. It uses a set of 64 printable characters (A-Z, a-z, 0-9, +, /) to represent binary data in 6-bit groups, with padding characters (=) added to make the total length a multiple of 4.

The name "Base64" comes from the fact that each encoded character represents 6 bits, and 2^6 equals 64. The scheme was standardized in RFC 4648 and is used universally across web and systems programming for safely transmitting or storing binary data in contexts that only handle text. This tool encodes and decodes with full UTF-8 support, so characters in any language, including emoji and CJK scripts, are handled correctly.

When to Use Base64

Base64 is used in many common development scenarios. Data URIs embed images, fonts, and other assets directly inside HTML or CSS files by encoding the binary file as a Base64 string prefixed with a MIME type declaration. This eliminates extra HTTP requests for small assets.

API payloads often require Base64 when sending binary content like files or images through a JSON body, since JSON only supports text and cannot represent raw bytes. Email attachments use Base64 (via MIME encoding) to transmit binary files as safe ASCII text through email protocols. JWT tokens use Base64URL encoding (a URL-safe variant) to encode their header and payload sections, making them safe to pass in URLs and HTTP headers. Understanding and manipulating Base64 is a foundational skill for web and backend development.

How to Use This Base64 Tool

To encode text to Base64: type or paste your plain text into the input box, select Encode mode using the toggle, and click the Encode button. The Base64 string appears in the Output panel below. Click Copy to copy it to your clipboard.

To decode a Base64 string back to plain text: paste the Base64 string into the input box, select Decode mode, and click the Decode button. If the string is valid Base64, the original text appears in the output. If the input is invalid, a clear error message tells you what went wrong.

The Swap button lets you move the output back into the input field for chaining operations. The Clear button resets everything. The auto-detect feature checks whether your input looks like Base64 and offers a one-click suggestion to switch to Decode mode.

Base64 vs Other Encoding Methods

Base64 is not the only encoding method, and choosing the right one depends on your use case. URL encoding (percent-encoding) converts special characters in URLs to percent signs followed by hex digits (for example, space becomes %20). It is designed for query strings and URL components, not for general binary data.

Hex encoding converts each byte to two hexadecimal digits, producing a string that is twice the size of the input. It is easy to read and widely used in cryptography and debugging, but less space-efficient than Base64. Base64 is more compact than hex (33% overhead vs 100% overhead) but harder to read directly.

Base64URL is a variant of Base64 that replaces + with - and / with _, making it safe for use in URLs and filenames without percent-encoding. JWTs and many OAuth implementations use Base64URL specifically. This tool uses standard Base64 (RFC 4648) which is appropriate for most data handling, API, and email attachment use cases.

Frequently Asked Questions

What is Base64?

Base64 is a binary-to-text encoding that represents binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is used to safely transmit or store binary content in systems that only handle text, such as email protocols, JSON APIs, and data URIs in HTML and CSS.

Why does Base64 increase data size?

Base64 encodes 3 bytes of binary data into 4 characters. Since each original byte is 8 bits but each Base64 character represents only 6 bits, you need more characters to represent the same amount of data. This results in an approximately 33% size increase compared to the original binary input.

Is Base64 encryption?

No. Base64 is an encoding scheme, not an encryption algorithm. It is fully reversible without any key. Anyone can decode a Base64 string back to the original data instantly. Do not use Base64 to protect sensitive information. Use proper encryption algorithms like AES for security-sensitive data.

Does this tool store my data?

No. All encoding and decoding happens entirely in your browser using JavaScript. Nothing you type or paste is sent to any server, logged, or stored anywhere. The tool runs completely client-side, so your data stays on your device.

What characters are valid in Base64?

Standard Base64 uses uppercase letters A-Z, lowercase letters a-z, digits 0-9, plus sign (+), and forward slash (/). Padding is added using the equals sign (=) at the end to make the total length a multiple of 4. Any other character in a Base64 string indicates invalid input and will cause a decoding error.

Related Tools