Image to Base64 Converter (and Base64 to Image)
Step 1: Choose your image
You can also paste an image with Ctrl+V. JPG, PNG, WebP, GIF and more.
Step 2: Pick the output format
Step 3: Press Copy output
Base64 to image
Images are processed in your browser. Nothing is uploaded to or stored on our server.
© 2004–2026 QuickOnlineTips. This tool’s code and design are our own work. You are welcome to use it here for free, but please do not copy, republish or sell it. Terms of use
Missing a feature, found a bug, or something confusing? Tell us in a line.
More image tools and other free tools
About this tool
Convert any image to Base64 text that you can paste straight into HTML, CSS, JSON or an email template. Choose a data URL, raw Base64, a ready-made <img> tag or a CSS background rule. You can also paste Base64 text to turn it back into an image and download it.
Quick answer: Choose an image and its Base64 data URL appears in the box, starting with data:image/png;base64,. Paste it into an src attribute or a CSS url() and the image shows without a separate file.
How to convert an image to Base64
- Click the box to choose an image, drag one in, or paste a screenshot.
- Pick the output: a data URL, Base64 only for APIs and JSON, a complete HTML img tag, a CSS background-image rule or Markdown.
- Click Copy output and paste it into your code.
- To go the other way, paste Base64 text or a data URL in the lower box and click Show image, then download it.
What is a Base64 image?
Base64 is a way to write binary data, such as an image file, using only 64 safe text characters: A to Z, a to z, 0 to 9, + and /. A data URL wraps it with the file type, for example data:image/jpeg;base64,/9j/4AAQ.... Browsers treat that text exactly like an image file, so you can put small images directly inside HTML, CSS, SVG, JSON or email code.
When to use Base64 images
- Good for: tiny icons, logos and placeholders under a few kilobytes, HTML emails that block external images, single-file HTML reports, and APIs that accept images as text.
- Not ideal for: photos and large images. Base64 is about 33 percent bigger than the file, cannot be cached separately, and makes your HTML or CSS slower to download and parse.
How to recognise the image type
| Base64 starts with | Image type |
|---|---|
/9j/ | JPEG |
iVBORw0KGgo | PNG |
R0lGOD | GIF |
UklGR | WebP |
PHN2Zy or PD94bWw | SVG |
Shrink the image first with the image compressor or image resizer to keep the Base64 short. To encode text instead of images, use the Base64 encoder and decoder.
FAQ
Is there a size limit?
Browsers handle data URLs of several megabytes, but keep inline images small for speed.
Is my image uploaded?
No. The conversion runs in your browser.
Get our free weekly email: new tech guides and tools, no spam.
New and updated tech guides, a free tool worth bookmarking and one useful pick, once a week. No spam, unsubscribe anytime.
One email a week. Unsubscribe anytime. See our privacy policy.






