The code box in your website builder, a CSS file or an app you connect to wants your logo as text, not as a file. Or an AI tool hands you a long string that starts with data:image/png and you cannot see the picture. This page turns pictures into Base64 and Base64 back into pictures.
How to turn an image into Base64
- Drop your pictures on the box, or tap Choose pictures. Up to 30 at once.
- Under Copy as, pick Data URI, Base64 only, HTML, CSS, Markdown or JSON.
- Tap Copy code. With several pictures, Copy all takes them in one go, and Download as a file saves them in one text file.
To go the other way, tap Base64 to image, paste the code and save the picture. A whole <img> tag or CSS line works too.
Where the long string comes from
Base64 writes a file as plain letters and numbers. Text can go where a file cannot: inside a web page, a CSS file or a message between two apps. A data URI is that text with a label in front, like data:image/png;base64,, so the browser knows it is a PNG.
Why it goes wrong with big pictures
You paste a phone photo as Base64 into a page, and the page gets slow on every visit. Every 3 bytes of the file become 4 letters, so the code is about a third bigger than the file. A 30 KB logo becomes about 40 KB of text.
There is a second cost. A browser keeps a normal picture file and reuses it on the next page. Code inside a page comes down again with every page. So a tiny icon wins, and a big photo loses. The tool marks each picture: up to 8 KB of code is small, over 100 KB is large. For a large one, use a normal file, or make it smaller first with the image compressor.
Email is the other trap. Gmail and many other email apps do not show Base64 pictures, so your logo in a signature or a newsletter turns into an empty box. For email, link to a picture file on your site, and send a test email to yourself first.
What the tool does and does not do
- It keeps your file as it is. The code holds the exact bytes, so nothing is compressed again and no quality is lost. That also means the camera data in a phone photo stays in, the place it was taken too. Check it with the EXIF viewer first.
- SVG gets a smaller form. An SVG is already text, so the tool writes it as text with a few % codes when that is smaller than Base64. Line breaks become spaces and some quote marks change, which does not change the picture. You can switch this off under More options.
- HTML comes ready to use. The
<img>tag gets the width and height of the picture, and the alt text you type under More options. - It is not a lock. Anyone can turn Base64 back into the picture. It is not compression either.
- Files up to 10 MB. Bigger ones make more code than most places take.
Base64 on Instagram, TikTok, LinkedIn and X
Instagram, TikTok, LinkedIn, Facebook, Pinterest and X take picture files, not Base64. If an app or an AI tool gives you Base64, tap Base64 to image, save the picture and post the file. X takes pictures up to 5 MB and Pinterest up to 20 MB, so check the size the tool shows.
The picture in a link preview (the og:image tag on your site) should be a normal web address too. The apps fetch it from your site when someone shares the link.
FAQ
Is my picture uploaded?
No. The page reads your picture in your browser and makes the code there. Nothing is sent anywhere, and nothing is kept after you close the tab.
Why is the Base64 code bigger than my file?
Base64 uses 4 letters for every 3 bytes, so the code is about 33% bigger than the file. The tool shows both sizes for each picture.
How big is too big to put in my code?
Up to about 8 KB of code is fine almost anywhere. Over 100 KB, a normal picture file loads faster, because the browser can keep it and reuse it.
Does converting change my picture?
No. The code holds the same bytes as your file, so turning it back gives you the very same file. The one exception is an SVG written as text: its line breaks become spaces and some quote marks change, and it looks the same. Switch that off under More options to keep every byte.
How do I turn Base64 back into an image?
Tap Base64 to image at the top and paste the code. You see the picture, its size and its format, and you can save it as a file.
What is the difference between a data URI and Base64?
Base64 is only the code. A data URI is the same code with data:image/png;base64, in front, which tells a browser what kind of file it is. HTML and CSS need the data URI. Many apps that take a picture through their API want Base64 only.