Image to Base64 Converter: Encode Images to Base64 and Back Free
Turn any PNG, JPG, GIF, WebP, SVG or ICO image into a Base64 string, ready-made data URI, HTML img tag or CSS background, each with a copy button. Paste Base64 to decode it back into an image. Everything runs in your browser with no upload.
100% private: files are processed by your browser. Nothing is uploaded to GrowthPi or anyone else.
How to use the Image to Base64 Converter
- 1
Drop an image into the box, click to choose one, or paste a screenshot.
- 2
Copy the format you need: data URI, raw Base64, HTML img tag, CSS background or Markdown.
- 3
To go the other way, open Base64 → Image, paste the string and click Decode to download the image.
What is Base64 image encoding?
Base64 is a way to write binary data, such as an image file, using only 64 plain-text characters: A-Z, a-z, 0-9, + and /, with = as padding. Once an image is written as text, you can paste it straight into places that only accept text: an HTML page, a CSS file, a JSON API request, an email template or a configuration file.
A data URI wraps that text with a small header that tells the browser what it is, for example data:image/png;base64,iVBORw0KGgo.... Put a data URI where you would normally put an image URL and the browser shows the image without downloading a separate file.
How to convert an image to Base64
- Add your image. Drag it in, click to choose, or paste a screenshot with Ctrl+V or Cmd+V.
- Check the preview. You see the image, its type, its pixel size and how big the Base64 version is.
- Copy what you need. Every output has its own Copy button:
| Output | Looks like | Use it in |
|---|---|---|
| Data URI | data:image/png;base64,iVBOR... | src, href, JSON fields, JavaScript |
| Base64 only | iVBORw0KGgoAAAANSUhEUg... | APIs that ask for "base64 image" without a prefix |
| HTML img tag | <img src="data:image/png;base64,..." alt="..."> | Web pages, HTML emails |
| CSS background | background-image: url("data:..."); | Stylesheets, small icons and patterns |
| Markdown |  | README files and notes apps that support it |
How to decode Base64 to an image
Switch to Base64 → Image and paste the text. It can be raw Base64, a full data URI, or even a whole <img> tag or CSS rule; the tool finds the Base64 part. It also accepts the URL-safe alphabet (- and _) and missing = padding. The tool detects the real image type from the data itself (PNG, JPG, GIF, WebP, SVG, BMP, ICO or AVIF), shows a preview, and gives you a file to download. This is handy when an API, a database export or a browser developer tool hands you an image as text.
When should you embed images as Base64?
Base64 makes files about 33% bigger than the original image (every 3 bytes become 4 characters), and an embedded image cannot be cached separately by the browser. So it is a trade-off:
| Good idea | Usually a bad idea |
|---|---|
| Tiny icons, logos and UI sprites (a few KB) | Photos and large images |
| Single-file HTML reports or offline pages | Images reused across many pages |
| Images inside JSON for an API that requires it | Anything over roughly 100 KB |
| Placeholder or "blur-up" previews | Pages where load speed matters most |
For anything large, a normal image file is faster. Shrink it first with the image compressor or convert it to a lighter format with JPG to WebP. The tool warns you when an image is over 1 MB. For small vector logos, an SVG data URI is often smallest; for raster versions use SVG to PNG.
Base64 images in HTML email
Email is where people most often try Base64 images, with mixed results. Some clients, notably Gmail on the web and some Outlook versions, block or strip data-URI images. For newsletters, hosted images or images attached with a content ID are more reliable. Test before you send. Our guide to email marketing for beginners covers the basics of building emails that display well.
Base64 is not encryption
Base64 only changes how data is written; anyone can decode it in a second, including with this page. Never treat a Base64 string as a way to hide a password, an API key or a private photo. If you need to protect a document, use real encryption, such as our Protect PDF tool for PDFs, and keep passwords in a manager (see password managers explained).
Common problems
- "Not valid Base64": the text contains characters outside the Base64 alphabet, often because it was cut off or has quotes or line numbers copied with it. Copy the full string again.
- Image shows as broken in a page: check that the data URI has the right type, such as
image/pngfor a PNG, and that nothing was trimmed from the end. - The string is huge: that is normal for large images. Resize the image first with the image resizer.
Private by design
Encoding and decoding happen inside your browser with the FileReader API, so your images and strings are never uploaded to GrowthPi or anyone else. You can even use the page offline once it has loaded.
Last updated November 5, 2026.
Image to Base64 Converter FAQ
How do I convert an image to Base64?
Drop the image into the box above. The Base64 string, data URI, HTML tag and CSS snippet appear instantly, each with a Copy button. Nothing is uploaded.
How do I convert Base64 to an image?
Open the Base64 → Image tab, paste the Base64 string or data URI, and click Decode to image. Preview it and click Download to save the file.
What is a data URI?
A data URI is the Base64 text with a short header such as data:image/png;base64, in front. Browsers can display it anywhere an image URL is accepted, without loading a separate file.
Does Base64 make images bigger?
Yes, by about 33%, because every 3 bytes of the image become 4 text characters. That is why Base64 is best for small icons and logos, not photos.
Is Base64 encoding secure?
No. Base64 is not encryption; anyone can decode it instantly. Use it to embed images, never to hide private information.
How do I use a Base64 image in CSS?
Copy the CSS background output and paste it into your rule, for example .logo { background-image: url("data:image/png;base64,..."); }.
