Image to Base64 Converter

Convert an image into a Base64 data URI for embedding in HTML/CSS, or decode a Base64 string back into an image. Everything runs locally in your browser.

๐Ÿ”’ Processed on your device ยท No upload ยท No account ยท No watermark

โœ… Copied to clipboard!
Supports JPG, PNG, WEBP and other common image formats.

Represent binary image bytes as text

Base64 represents binary bytes with a restricted set of text characters. An image data URI combines that encoded text with its media type so it can be placed inline in HTML or CSS, and sometimes inside JSON or API payloads. This can simplify small self-contained assets, but it increases their size, reduces normal browser caching and can make source files harder to maintain.

For inline assets, payloads and quick inspection

  • Embed a small image directly in HTML or CSS
  • Prepare image data for a JSON field or API that explicitly accepts Base64
  • Test an inline image in a compatible email template
  • Preview or download the image represented by a Base64 string

Frequently asked questions

Does Base64 encoding increase file size?
Base64 encoding adds roughly one third to the binary byte count before the data-URI prefix or text compression. The exact stored or transmitted size depends on surrounding formats and compression, so it is usually better suited to small assets.
Can I paste a Base64 string without the "data:image/..." prefix?
Yes. The decoder can attempt to identify supported image bytes from raw Base64. Supplying a correct data:image/... prefix is safer when the format is known.
Is my image or Base64 data uploaded anywhere?
No. Encoding and decoding run locally with JavaScript.
What image formats are supported?
It handles JPG, PNG, WEBP, GIF and other image formats that the browser can recognize and display.

๐Ÿ“– Want the full picture? Read our guide: What is Base64 encoding and when developers need it for images

Related tools