Base64 Encode / Decode
Encode or decode text and files to and from Base64.
File to Base64 (data URL)
Our Base64 Encode / Decode tool quickly converts text and files to and from Base64, a compact ASCII representation for binary data. We tested it with plain text, images and small documents; it’s browser-based, responsive, and useful whenever you need to embed binary data in text-only contexts or inspect encoded payloads. It’s not encryption — it’s a reversible encoding — so treat sensitive content accordingly.
What the tool does and who it's for
The tool performs two simple operations:
- Encode: turn text or a file (image, PDF, etc.) into a Base64 string you can paste into JSON, HTML data URIs, or email bodies.
- Decode: turn a Base64 string back into readable text or download it as the original binary file.
This is ideal for developers, QA engineers, web designers, and anyone working with APIs, email attachments, or embedding assets inline in documents. We find it especially handy for quick debugging, creating data URIs for small images, and preparing test payloads for REST endpoints.
How to use it
Using the tool is straightforward — here’s a quick how-to:
- Choose Encode or Decode.
- Either paste your text into the input box or drag-and-drop/upload a file.
- Select any needed options (for example, a URL-safe Base64 variant or line-wrap behavior).
- Click the action button to run the conversion.
- Copy the output string or download the decoded file. If the decoded result is binary, save it and open it with the appropriate application.
Common use cases
- Embedding images in HTML: convert a small PNG or SVG to a data URI so you don’t need a separate asset request.
- APIs and payloads: include binary attachments inside JSON or XML by embedding Base64 strings.
- Authentication tokens: inspect or generate basic HTTP auth strings (username:password → Base64).
- Email and MIME: verify or create encoded attachments when troubleshooting mail clients or servers.
- Database storage: store small binary blobs in text columns when necessary (though not always recommended).
- Debugging and learning: decode Base64 strings you find in logs or network traces to see the underlying content.
Practical tips
- Remember UTF-8: when encoding text, ensure it’s in UTF-8 so special characters survive the round trip. We saw incorrect characters only when a non-UTF-8 source was used.
- Watch file size: Base64 increases data size by about a third. For large files the process will be slower and the output bulkier; the tool is best for small-to-medium files and snippets.
- Not encryption: Base64 is reversible. Do not use it to protect passwords or secrets.
- URL-safe variant: choose the URL-safe option if you plan to embed the string in a URL or query parameter (it replaces + and / with - and _).
- Line breaks: some systems expect wrapped lines (MIME) while others expect a continuous string. Toggle wrapping if you encounter parsing errors.
- Binary output: when decoding non-text data, download the result rather than viewing it in the browser to preserve file integrity.
How to encode and decode Base64
- Choose Encode or Decode, then type or paste your text.
- Copy the result with one click.
- Or convert any file to a Base64 data URL in the file section.
Frequently asked questions
Is Base64 encryption?
No. Base64 is an encoding, not encryption. It only changes how data is represented and offers no security.
Does it handle emoji and accents?
Yes. Encoding and decoding are UTF-8 safe, so unicode characters like é, 你好 or emoji round-trip correctly.
Is my data sent anywhere?
No. All encoding, decoding and file conversion happens entirely in your browser.