Image to Base64 Converter – Get a Data URI, HTML or CSS Code (Free)
Convert JPG, PNG, GIF, WebP, SVG and other pictures to Base64 and copy the result in the form you need: a full data URI, the raw Base64 string, an HTML <img> tag, a CSS background-image rule or a Markdown image. It shows the picture, its size and how much bigger the Base64 text is. Everything runs in your browser, so your pictures are not uploaded.
Drop pictures here
JPG, PNG, GIF, WebP, SVG and more · up to 10 files, 4.00 MB each
Your files stay on your device. Nothing is uploaded.
How to use it
- Drop your pictures on the box, or choose them.
- Pick how you want the text: Data URI, Base64 only, HTML <img>, CSS background or Markdown.
- Press Copy, or download the text as a file.
- Paste it into your HTML, CSS, email template or code.
Frequently asked questions
Are my pictures uploaded?
No. Your pictures are opened and changed in your browser, on your own device, and are never sent to our server. Close the page and they are gone.
What is a data URI?
A data URI puts the whole file inside the address, in the form data:image/png;base64,… so a page can show the picture without loading a separate file. It works in img tags, CSS url() and most email and document formats.
Why is the Base64 text bigger than my file?
Base64 writes every 3 bytes as 4 characters, so the text is about one third larger than the picture. A 30 KB icon becomes about 40 KB of text.
When should I use Base64 pictures?
For small things: icons, tiny logos, placeholder images, and pictures in HTML emails or single-file pages. They save a request, but they cannot be cached on their own, so for large pictures a normal image file is better.
Why is there a size limit?
Because of the one-third growth, big pictures make very long text that is slow to select and paste. The limit is 4 MB per picture. Make a picture smaller first with the image resizer or the compress image tool.
How do I turn Base64 back into a picture?
Paste it into the Base64 encoder and decoder. It shows a preview of the picture and lets you download the file.
Related tools
Base64 Encoder & Decoder
Encode text or files to Base64 and decode Base64 back, with URL-safe and UTF-8 support. Runs in your browser.
Compress Image to 20KB, 50KB, 100KB or Any Size (Free)
Make a photo or signature no bigger than the file size you set, such as 20 KB, 50 KB or 100 KB.
Image Resizer – Resize Photos by Pixels or Percentage (Free)
Resize pictures to an exact width and height, or by percentage, with ready sizes for social media.
SVG to PNG Converter – Convert SVG to PNG, JPG or WebP (Free)
Turn SVG files into PNG, JPG or WebP at the size you want, with a transparent or coloured background.
These tools run entirely in your browser and are provided free, without warranty. Check important results before using them in production.