Base64 Encoder/Decoder

Input

Enter text to encode
0 characters

Settings

URL-safe mode replaces + with - and / with _ for safe use in URLs.

Output

Base64 encoded result
0 characters

About This Tool

Base64 encoding comes up more often than you'd think in development work. I originally created this tool when I needed to quickly encode authentication credentials for HTTP Basic Auth headers during API integration testing. Since then, I've used it for embedding small images in CSS data URIs, encoding JWT payloads for inspection, decoding email attachments, and preparing multipart form data. The tool supports both standard Base64 and URL-safe variants (replacing + and / with - and _), which is crucial when encoding data for URLs or filenames. All processing happens in your browser—no data is uploaded to any server, making it safe for encoding sensitive credentials or customer information.

How to Use

For encoding: paste your plain text into the input field and click Encode. The output shows Base64-encoded string ready to copy. For decoding: paste Base64 string and click Decode to retrieve original text. Toggle 'URL-safe mode' when encoding data that will be used in URLs, query parameters, or filenames—this replaces problematic characters. The tool automatically detects encoding errors (invalid Base64 characters) and shows warnings. Works with UTF-8 text including emojis, special characters, and multi-byte languages. For binary files or images, use the file upload option.

Common Use Cases

HTTP Basic Auth

Encode 'username:password' to create Authorization header: `Basic dXNlcm5hbWU6cGFzc3dvcmQ=`.

Data URIs

Encode small SVG icons or images to embed directly in HTML/CSS without external files.

JWT Inspection

Decode JWT token parts (header and payload are Base64-encoded JSON) to inspect claims without verification.

Email Debugging

Decode Base64-encoded email attachment content to verify data.

API Testing

Encode JSON payloads for APIs that expect Base64-encoded request bodies.

Limitations & Important Notes

Base64 encoding increases data size by approximately 33% (4 characters for every 3 bytes of input)—not suitable for large file transfers. This tool is text-focused; while it handles UTF-8 well, true binary file encoding (like images or PDFs) should be done with specialized tools or programming libraries. Base64 is NOT encryption—it's merely encoding for safe text transmission. Anyone can decode it instantly. For file uploads, browsers may limit size to ~50-100MB depending on available memory. For very large datasets, use command-line tools like base64 (Unix/Linux/Mac) or certutil (Windows).