Image to Base64 Converter

Convert images to Base64 strings and decode Base64 back to images. Everything stays in your browser.

🖼 Drop your image here or click to browse

Supports JPEG, PNG, GIF, WebP, BMP, SVG

✨ AI-Powered Tip

When to use Base64: Base64 encoding is ideal for small images (under 10KB) that need to be embedded directly in code. Common use cases include email templates, CSS background images, inline SVGs, and JSON API payloads.

The 33% overhead: Base64 encoding increases data size by ~33%. A 100KB image becomes ~133KB as text. For images larger than 10KB, regular file URLs are usually more efficient.

CSS usage: Use the full Data URI in your CSS: background-image: url(data:image/png;base64,...);

HTML usage: Use the Data URI directly in img tags: <img src="data:image/png;base64,...">

How to Convert Image to Base64

  1. Choose your mode: “Image to Base64” to encode, or “Base64 to Image” to decode.
  2. To encode: Upload an image by clicking or dragging. The tool generates both a full Data URI and the raw Base64 string.
  3. To decode: Paste any Base64 string or full Data URI into the text box and click “Decode to Image”.
  4. Copy or download: Use the Copy buttons to grab the Base64 text, or Download to save the decoded image.

Base64 Size Overhead

Original SizeBase64 SizeOverhead
1 KB~1.37 KB+33%
10 KB~13.7 KB+33%
50 KB~68.3 KB+33%
100 KB~136.5 KB+33%
500 KB~682.7 KB+33%
1 MB~1.37 MB+33%

Common Use Cases

  • HTML Emails: Embed images directly in emails without external hosting, ensuring they always display.
  • CSS Backgrounds: Inline small background images to reduce HTTP requests and speed up page load.
  • JSON APIs: Include image data directly in API responses without needing separate file endpoints.
  • Data URIs: Create self-contained HTML documents with embedded images for offline use.
  • SVG Optimization: Encode SVG icons for inline use in web pages and applications.

Frequently Asked Questions

What is Base64 encoding?

Base64 is a method of converting binary data (like images) into a text string using 64 printable ASCII characters. This allows images to be embedded directly in HTML, CSS, JSON, or emails without needing a separate file.

When should I use Base64 images?

Use Base64 for small images like icons, logos, or inline graphics in HTML emails, CSS backgrounds, or JSON APIs. For large images or regular web pages, regular file URLs are more efficient.

Does Base64 increase file size?

Yes, Base64 encoding increases data size by approximately 33%. A 100KB image becomes roughly 133KB as Base64 text. This is the tradeoff for not needing a separate file reference.

Can I convert Base64 back to an image?

Yes! Switch to the “Base64 to Image” mode, paste your Base64 string (with or without the data:image/... prefix), and the tool will display a preview of the image.

Is my data sent to a server?

No. All encoding and decoding happens locally in your browser using the FileReader API and Canvas. Your images and Base64 strings are never uploaded or transmitted.

More Free Tools