Image to Base64

Encode an image as a Base64 data URI for inline embedding.

Convert any image to a Base64 data URI suitable for embedding directly in HTML, CSS or JSON. Useful for icons in emails, single-file demos and tiny inline assets.

Common use cases

  • Embed small icons inline in HTML emails to avoid external image fetches
  • Inline assets in single-file CodePen / JSFiddle / StackBlitz demos
  • Embed images in JSON payloads when separate file uploads aren't possible
  • Inline above-the-fold images as data URIs to remove a render-blocking request

Frequently asked questions

When should I inline images as Base64?β–Ύ
Only for very small icons (≲4 KB) or single-file deliverables. For most websites, separate image files compress and cache better.
Why is my Base64 longer than the original file?β–Ύ
Base64 adds about 33% overhead by design β€” it encodes 3 binary bytes as 4 ASCII characters. That's expected.

Related tools