Base64 Codec
Encode and decode Base64 strings, with file-to-data-URL support for images and binary files. Copy and clear. 100% offline.
About this tool
A two-way Base64 codec that handles both text and files. The top section is for plain text: type or paste, then tap Encode to produce the Base64 string, or paste a Base64 string and tap Decode to recover the text. The file section supports drag-and-drop — drop any image, PDF, or binary file and the tool generates a data URL (Base64 + MIME type) ready for CSS backgrounds, markdown image embeds, or HTML inline. The decode side accepts both raw Base64 and full data URLs. Works fully offline — no upload, no server, no third-party library.
Details
- Category
- developer
- Version
- 1.0.0
- Size
- 14 KB
- Updated
- Jun 2026
Frequently Asked Questions
What is Base64?
Base64 is a binary-to-text encoding that uses 64 ASCII characters (A–Z, a–z, 0–9, +, /) plus = for padding. It is used everywhere binary data has to travel through a text channel — JSON payloads, URL parameters, email attachments (MIME), CSS, and HTML inline assets.
Why does Base64 make files bigger?
Base64 represents every 3 bytes as 4 characters, so encoded output is ~33% larger than the binary. That's the price of using only printable ASCII. For text this is usually a non-issue, but for large images you should prefer a regular file URL.
Are my files uploaded anywhere?
No. Everything — text and file — is read and encoded locally using the FileReader and btoa APIs. Nothing leaves your device. The only network this tool uses is the initial HTML download.
How big a file can I drop?
Technically only by available memory. The tool shows the data URL size after encoding so you can decide. For images and small PDFs (under a few MB) it is instant; for very large files (50 MB+) the browser may slow down or show a "file too large" warning.
What is a data URL?
A data URL is a Base64 string prefixed with data:<mime-type>;base64, — the browser treats it as a regular URL. Use it for CSS backgrounds (background-image: url(...)), markdown images (), or HTML <img src="data:..."> embeds without needing a separate file.