Base64 Encode and Decode
Encode text to Base64 or decode Base64 to text. UTF-8 safe. Use the mode switch to choose encode or decode. Input limited to 5MB. Copy result to clipboard.
Encode text to Base64 or decode Base64 to text on one page. Use the Mode dropdown to switch between Encode (text → Base64) and Decode (Base64 → text). Paste or type your input and click the button. The tool uses UTF-8, so Unicode characters (e.g. accented letters, emoji) are supported. Input is limited to 5 MB. Copy the result with the Copy button. Base64 is commonly used for embedding binary data in URLs, email, or JSON.
Loading…
Examples
- Hello → SGVsbG8= (encode)
- SGVsbG8= → Hello (decode)
- Hello World → SGVsbG8gV29ybGQ= (encode)
FAQ
What is Base64?
Base64 encodes binary data as ASCII text using 64 characters (A-Z, a-z, 0-9, +, /). It is often used for embedding data in URLs or JSON. Decoding converts the Base64 string back to the original data (e.g. UTF-8 text).
Does it support Unicode?
Yes. The tool encodes and decodes UTF-8 text. Non-ASCII characters (e.g. é, 中文) are handled correctly.
What is the output padding?
Base64 uses = for padding so the length is a multiple of 4. The tool follows standard Base64 encoding.
Why do I get 'Invalid Base64' when decoding?
The input must be valid Base64 (A-Z, a-z, 0-9, +, /, and = for padding). Remove spaces or line breaks if you pasted from a wrapped format.
What is URL-safe Base64?
Standard Base64 uses + and / which have special meaning in URLs. URL-safe Base64 replaces + with - and / with _, producing strings safe to use directly in URLs and filenames without percent-encoding.
How does Base64 work in data URIs?
Data URIs embed file content directly in HTML or CSS: data:image/png;base64,iVBORw0KGgo…. Encode a small image to Base64 and paste it into a src attribute to include it inline without a separate HTTP request.
What are the parts of a JWT token?
A JWT has three Base64url-encoded parts separated by dots: header.payload.signature. The header and payload are JSON objects. Decode the header or payload here to read the algorithm and claims — but remember the signature is not verified by this tool.
How does Base64 appear in email attachments?
Email attachments use MIME encoding. Binary files (images, PDFs) are Base64-encoded in the email body. The encoded data is split into 76-character lines. This is why forwarded emails sometimes show large blocks of seemingly random text.
How much does Base64 increase file size?
Base64 encodes 3 bytes as 4 characters, adding about 33% overhead. A 1 MB file becomes roughly 1.37 MB when Base64-encoded. This is the main reason not to use Base64 for large files in web APIs.
Is Base64 encryption?
No. Base64 is encoding, not encryption. Anyone can decode a Base64 string without a key. Never rely on Base64 to hide sensitive data. Use proper encryption (AES, RSA) for security.
How do I decode a Base64 image?
Remove the data URI prefix if present (e.g. remove 'data:image/png;base64,'). Paste the remaining string and decode. You'll get the raw binary content. To view it, re-add the data URI prefix and paste into a browser address bar.
How is Base64 used in HTTP Basic Auth?
HTTP Basic Authentication encodes credentials as Base64: btoa('username:password') → Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=. This is not secure on its own — always use HTTPS, and prefer token-based auth.