Paste text or drop a file to get Base64, or paste Base64 to get the original back.
How It Works
Text takes anything you type or paste. File takes any file you drop on it. Image is the same thing with a preview and ready-made snippets.
Text encodes as you type, and the Decode tab turns Base64 back into the original. Paste a data URL, a wrapped block or URL-safe Base64 and it still works.
Copy the Base64, the data URL or the ready-made img tag and CSS rule. Or publish a share page that shows the result on a live link.
About This Tool
Base64 is how binary data travels through places that only accept text. Getting it right means getting Unicode and large files right.
Base64 rewrites arbitrary bytes using only 64 safe characters - A-Z, a-z, 0-9, + and / - so they survive a journey through something that was only ever designed to carry text: an email header, a JSON field, a database column, a URL, or the src attribute of an <img>. It is an encoding, not encryption. Anybody can decode it in a second, so it hides nothing. Because four characters stand in for every three bytes, the result is always about a third larger than what went in.
Usually somebody who is not a developer and has been handed an instruction. A theme wants a logo “as a data URL”. An API returns a document as one long string that has to be turned back into a PDF. A no-code tool refuses a file upload but accepts a pasted data: value. An email signature has to travel as a single block of HTML with the picture inside it. All four of those are a Base64 encode or decode, and all four are handled by the three tabs above.
Most pages offering to base64 encode text call the browser's built-in btoa(). That function maps one character to one byte, so anything above U+00FF - an emoji, a Chinese character, a curly quote, even a plain é - makes it throw an error. That is why so many of these tools die on the first accent in a French name. This one converts your text to UTF-8 bytes first and encodes the bytes, then reverses exactly that on the way back, so emoji, accented Latin, Chinese, Arabic and an empty string all come out the way they went in.
The second common bug is size. The usual shortcut for files, String.fromCharCode(...bytes), passes every byte as a separate function argument and overflows the call stack somewhere around a couple of hundred kilobytes, which is why a lot of encoders quietly fail on a real photo. This one walks the file three bytes at a time and never spreads anything, so the only real limit is your device's memory. We cap uploads at 25 MB, and the read-only boxes show the first 60,000 characters of a very long result while Copy still hands over every character.
Real Base64 rarely arrives clean. It comes wrapped in a data: URL, inside a CSS url(), in quotes from a JSON file, split across lines by an email client, percent-escaped from a query string, in the URL-safe alphabet that uses - and _, or with the = padding stripped off. The decoder accepts all of that, tells you what it had to fix, and shows a plain-English message instead of throwing when the input genuinely is not Base64. If the data turns out not to be text at all it says so and names the format it recognised, rather than filling the pane with replacement characters.
Sometimes the point of encoding an image is to send it to someone, and a wall of Base64 in a chat message is not that. The Publish button turns your result into a real web page on a free HTTPS link - for an image, a page that displays the picture straight from its data URL, with the snippets underneath. No account is needed, the link lasts 30 minutes unless you claim it, and claiming it is free. If you also need to escape that markup for a page, the HTML encoder is next door, and how publishing works explains the rest.
Questions
More Free Tools
Every tool here runs in your browser and ends the same way: one click and your HTML is on a live link.
Convert <, >, &, quotes and any special character into safe HTML entities. Paste text, copy the encoded result. Free and in-browser.
Convert PNG, JPG, GIF, BMP, AVIF or SVG to WebP with a quality slider and see the size drop. Batch convert, download one by one. Nothing is uploaded, it all runs in your browser.
Change text to uppercase, lowercase, sentence case, title case, camelCase, snake_case, kebab-case or CONSTANT_CASE in one click. Free, instant, in your browser.
Try It Now
Still Here? Drop It In.
The whole pitch fits in one sentence: your HTML, on a link, in seconds.
Drag and drop your HTML file(s), folders, or ZIP file
or ·
No account needed. Your unclaimed website stays live for 30 minutes on a free subdomain. Claim it to your account to keep it permanently.