Paste Base64 to get the original back, or turn text, images and any file into Base64. You can paste a whole data URI such as data:image/png;base64,... — the prefix is detected and stripped for you. Decoded images are previewed inline; binary data gets a download button. Everything runs locally in your browser and nothing is uploaded.
About Base64 encoding and decoding
Is Base64 encryption?
No — and this is the single most important thing on the page. Base64 is encoding: it re-expresses arbitrary binary data using 64 printable characters (A-Z a-z 0-9 + /). There is no key and no secret; the rules are public and anyone can reverse it in one step. It solves "this channel only carries text and I need to push an image through it", not "I need to make this unreadable". So Base64-ing a password, an ID number or an API key before storing it in a database or embedding it in front-end code provides no protection whatsoever. If you genuinely need something irreversible, see SHA-256 Hash Generator; to store passwords, use a slow hash such as bcrypt.
A data:text/html;base64 link won't open — how do I get the content out?
These links look like data:text/html;charset=utf-8;base64,PGh0bWw+... and typically come from the share feature in QQ Mail and some forums. They fail to open not because the link is broken: since 2017 Chrome has blocked top-level data: navigation, with Firefox and Edge following suit, because the feature was heavily abused for phishing — an entire fake login page fits inside one link, and the address bar cannot show a real domain for it.
The content is still in the link. Paste the entire link (including the data:text/html;charset=utf-8;base64, prefix) into the decode box above and this page will detect the prefix, strip it, and decode the rest. If the result is HTML, you will see the full page source.One word of caution before you look: if the link came from a stranger, there is a fair chance it is a phishing page. Decoding it to read the content is fine — just never fill in the account and password fields it contains.
What image-to-Base64 is actually for
Mostly embedding: writing a small icon straight into CSS as background-image: url(data:image/png;base64,...) or into HTML as <img src> saves one HTTP request; it is also how you get an image into JSON, Markdown or an email body, none of which carry anything but text. The cost is about 33% more bytes (every 3 bytes become 4 characters), and an embedded image cannot be cached separately by the browser — change one byte and the whole CSS file's cache is invalidated. So it only suits icons of a few KB; photos and large images belong behind a URL. Tick "Add the data URI prefix" above to get a complete string you can paste straight into code.
Why does some Base64 contain - and _, or end without =
That is the URL-safe variant (RFC 4648 §5). In the standard alphabet, + and / have special meanings in URLs and filenames and get escaped or truncated inside a query parameter, so they are replaced with - and _; the trailing = padding is equally awkward in a URL and is usually dropped. This is exactly how the three segments of a JWT are encoded. This page recognises both forms when decoding, so you never have to substitute characters by hand; tick "URL-safe alphabet" to produce this form when encoding.