QuickDevTools

Base64 Encode / Decode

Encode text to Base64 or decode Base64 strings back to plain text. Supports UTF-8 and binary data.

All processing happens in your browser

How to Encode and Decode Base64 Online

1

Choose your operation

Select whether you want to encode plain text to Base64 or decode an existing Base64 string back to readable text. The tool supports both directions with a single click toggle.

2

Enter your input

Paste the text you want to encode, or the Base64 string you want to decode. The tool handles UTF-8 characters, special symbols, and multi-byte characters like emoji correctly.

3

Copy the output

The result appears instantly as you type. Click the copy button to grab the encoded or decoded output for use in your API headers, data URIs, email attachments, or wherever you need it.

Common Use Cases

Encoding API credentials for HTTP Basic Authentication headers

Decoding Base64-encoded email attachments or MIME content

Creating data URIs for embedding small images directly in HTML or CSS

Encoding binary data for safe inclusion in JSON payloads

Debugging encoded strings found in JWT tokens or OAuth flows

Preparing file content for upload via REST APIs that expect Base64 input

Base64 Encoding Explained: When and Why Developers Use It

Base64 encoding is one of those fundamental tools that every developer encounters but few take the time to fully understand. At its core, Base64 converts binary data into a text representation using 64 printable ASCII characters, making it safe to embed in contexts where raw binary would cause problems. The encoding works by taking three bytes (24 bits) of input at a time and splitting them into four 6-bit groups. Each 6-bit value maps to one of the 64 characters in the Base64 alphabet. When the input length isn't divisible by three, padding characters (=) fill the gap. This simple mechanism has been standardized in RFC 4648 and is implemented in virtually every programming language. The most common use case you'll encounter is HTTP Basic Authentication, where credentials are sent as a Base64-encoded "username:password" string in the Authorization header. Despite appearances, this provides zero security on its own — it's purely for safe text transmission. That's why Basic Auth should always be used over HTTPS. Data URIs are another everyday use. By prefixing Base64-encoded file content with a MIME type (like data:image/png;base64,...), you can embed small images directly in HTML or CSS. This eliminates an HTTP request per image, which can improve performance for icons and small graphics, though it increases the HTML document size and bypasses browser caching. In email, Base64 is the backbone of MIME encoding for attachments. When you attach a PDF to an email, your client Base64-encodes the file content so it can travel through SMTP servers that only handle 7-bit ASCII text. The receiving client decodes it back to the original binary file. Modern APIs frequently use Base64 for file uploads in JSON payloads, webhook signatures, and encoded state parameters in OAuth redirects. Understanding the 33% size overhead is crucial — for a 1MB image, you're transmitting 1.33MB of Base64 text, which makes it impractical for large files where multipart form uploads or presigned URLs are better choices.

Frequently Asked Questions

Related Tools