Runs locally in your browser
Your tool input isn't sent to our servers.
Base64 Encoder & Decoder
Encode text or files as Base64, Base64URL, or Data URLs. Auto-detect encoded input, preview images, inspect binary bytes, and download decoded files—all locally in your browser.
How to use the Base64 encoder and decoder
- 1
Choose Text or File, then select Encode or Decode for the task you want to complete.
- 2
Enter UTF-8 text, upload a local file, or paste Base64, Base64URL, or a complete Data URL.
- 3
Copy the result, preview an image, inspect detected details, or download the decoded bytes as a file.
Standard Base64 vs. Base64URL
Both formats represent the same bytes. Base64URL changes two alphabet characters so the result can be used safely in URLs and JWT segments without percent-encoding. The decoder identifies either format automatically.
| Format | Distinct characters | Typical uses | Padding |
|---|---|---|---|
| Standard Base64 | A–Z a–z 0–9 + / | APIs, email, Data URLs, and file content | = is common |
| Base64URL | A–Z a–z 0–9 - _ | URLs, JWT segments, and filenames | Often omitted |
Unicode text is encoded as UTF-8 bytes
Base64 operates on bytes, not JavaScript characters. Before encoding, this tool converts text—including Chinese characters, accented letters, and Emoji—to UTF-8 bytes. Decoding reverses that process and reports an error when the resulting bytes are not valid UTF-8 text.
| Text | UTF-8 bytes | Base64 |
|---|---|---|
| Hello | 5 | SGVsbG8= |
| ✓ | 3 | 4pyT |
Encode files and create Data URLs
Switch to File mode to drag and drop a file up to 10 MB. Choose pure Base64 when you only need the encoded payload, or a Data URL when an application needs both the MIME type and the content. For images, the preview verifies the result before you copy it.
Pure Base64
Use the encoded payload in APIs, JSON fields, configuration, or other formats that provide their own metadata.
Data URL
Include the MIME type and Base64 payload in one value suitable for image sources, previews, and embedded resources.
File decode
Restore the original bytes, preview supported images, choose a filename and MIME type, then download the result.
Automatic detection and binary output
When decoding, the tool automatically detects Standard Base64, Base64URL, Data URLs, and whether padding is present. Valid decoded UTF-8 appears as readable text. If the bytes are not UTF-8, the input is still valid: the tool shows a hexadecimal preview and lets you download the binary data instead of incorrectly reporting a decoding failure.
Base64 size and padding
Base64 encodes every three source bytes as four text characters, so output is usually about 33% larger before a Data URL header or line breaks are added. File mode reports the original size, encoded size, and exact increase. One or two = characters may pad the final group; this tool can generate padded or unpadded output and accepts either form when it is valid.
Frequently asked questions
Does Base64 encrypt my data?
No. Base64 is a reversible encoding format, not encryption. Anyone can decode the result, so it should not be used to protect secrets.
Can this tool encode Chinese text and Emoji?
Yes. Text is converted to UTF-8 bytes before Base64 encoding, so Unicode characters such as Chinese, accented letters, and Emoji are preserved.
What is the difference between Base64 and Base64URL?
Standard Base64 uses + and /, while Base64URL uses - and _. Base64URL commonly omits = padding and is designed for URLs, filenames, and JWT segments. Both represent the same underlying bytes.
Can I decode Base64 that contains an image or another file?
Yes. Use File → Decode and paste pure Base64, Base64URL, or a Data URL. The tool detects the format, previews supported images, and lets you download the decoded bytes with your chosen filename.
Why does Base64 make files larger?
Base64 stores every three input bytes as four ASCII characters, which adds roughly 33% before headers or line wrapping. The file encoder shows the exact original size, encoded size, and increase.
Is my text sent to a server?
No. Encoding and decoding happen locally in your browser.