Get the Base64 text, a data URI, an img tag or a CSS rule for a picture. Nothing leaves your browser.
After the image is read, the page shows its Base64 text in the form you choose. Raw Base64 is just the encoded bytes, with no prefix, which is what an API or a JSON field usually wants. Data URI adds the prefix data:image/png;base64, so the text works as an img src, in an address bar or inside a CSS url(). HTML img tag wraps the data URI in an img element and adds the picture's width and height when the file header gives them. The alt text is left empty on purpose; write a short description there so a screen reader has something to say. CSS background-image gives a declaration of the form background-image: url("data:..."); that you can paste into a rule. The type in the prefix comes from the first bytes of the file, not from its name, so a PNG saved as photo.jpg is labelled image/png. Choosing another snippet changes the text and the downloaded .txt file straight away.
Base64 writes every 3 bytes as 4 characters, so the text is about 33% longer than the file, and a little more for very small files because of the padding at the end. The page shows the file size, the number of Base64 characters and the exact increase, for example +33.3%, next to the length of the snippet you chose. Above 100 KB it also shows a warning. Putting a large picture inline makes the HTML or CSS file bigger by about a third of the image, the browser cannot cache the picture separately from the page, and the page loads slower. Inlining suits small icons and placeholders, and a separate file suits photos. The largest image this page converts is 5 MB, because Base64 text that long is not practical to copy. If yours is larger, Compress Image can bring it down first.
The Base64 to image page reverses the conversion. Paste a data URI, a tag or CSS rule that contains one, or bare Base64 text. The standard and the URL-safe alphabets both work, the padding at the end may be missing, and spaces and line breaks are ignored. The text is checked, decoded and its type is read from the first bytes: PNG, JPEG, GIF, WebP and SVG are recognised. If the prefix says image/png but the bytes are a JPEG, the page says so and shows the picture as a JPEG. A data URI that is not Base64, text with a bad character, or data that is a PDF or another kind of file gives a plain message instead of a broken image. The picture is shown through an img tag and can be downloaded. An SVG is never inserted into the page itself, so scripts inside it do not run here.
One image at a time, JPEG, PNG, WebP, GIF or SVG, up to 5 MB. Pasted Base64 can decode to up to 10 MB. The text box shows the first 20,000 characters of a long value, and Copy and Download hold all of it. The image is read in this tab by your browser, converted here and kept only in the page's memory: there is no upload step, and the text is not stored or put in the address. The page counts visits with Google Analytics, using only the tool name and rough groups such as a size group, never the file name, the image or the text. Metadata inside the file, such as EXIF, is part of the bytes and is kept in the Base64, because the file is encoded as it is. Remove Photo Metadata first if the picture should not carry its location.
About a third. Every 3 bytes become 4 characters, so a 30 KB PNG gives roughly 40,000 characters of text. The page shows the exact numbers for your file, such as +33.3%, and the size of the snippet you chose.
Usually not. Above 100 KB the page warns you. The text makes the HTML or CSS about a third larger than the picture, it cannot be cached apart from the page, and a render-blocking stylesheet with a big data URI delays the first paint. Small icons and one-pixel placeholders are the good use.
Yes. The prefix is data:image/png;base64, or the matching type for JPEG, WebP, GIF or SVG. It is read from the first bytes of the file, so a wrong file extension does not change it.
No. Your browser reads the file in this tab and the text is built here. Nothing is sent to a server and nothing is saved. Reloading the page clears it.
Yes. An SVG is plain text, so its Base64 is about a third longer than the file. It is shown through an img tag, which does not run scripts inside the SVG. Open a downloaded SVG directly only if you trust where it came from.
This page is for pictures. Text, URL and HTML-entity conversions are on the Text Encoder page, which also handles accents and emoji.