How to convert an image to Base64
- 1Drop an image into the box, paste a screenshot from the clipboard, or choose Browse files.
- 2Pick an output format: data URI, raw Base64, HTML, CSS or Markdown.
- 3Copy the code and paste it into your page, stylesheet or API request.
Output formats
data:image/png;base64,iVBOR…Works anywhere a URL is accepted.iVBORw0KGgoAAAANSUhEUg…For JSON fields and APIs that expect only the Base64 part.<img src="data:image/png;base64,…" alt="">An inline image for HTML emails and single-file pages.background-image: url("data:…");Small icons and patterns without an extra request.README files and notes that support data URIs.When to inline an image
Base64 makes an image about a third larger, and an inlined image can’t be cached separately from the page. Inlining pays off for small icons, logos in HTML emails and single-file documents. For photos and anything over roughly 10 KB, a normal image file is usually faster.
Frequently asked questions
Is there a file size limit?
No fixed limit, since everything happens in your browser. Very large images produce very long strings that can slow down editors, so keep inlined images small.
Does converting change image quality?
No. The file’s bytes are encoded exactly as they are, with no resizing or recompression. Decoding gives back the identical file.
Do Base64 images work in email?
Apple Mail and most mobile clients show them. Gmail and some versions of Outlook block data URIs, so test in the clients your audience uses.
How do I turn the string back into an image?
Paste it into Base64 to image to preview and download it.