Encoding image locally…

Preparing the selected bytes and developer snippets.

64

Convert image to Base64

Preserve original image bytes or resize and re-encode, then copy production-ready Data URI, CSS, HTML and Markdown snippets.

Runs in your browserOriginal or optimized5 output styles
🔒 No image upload↔ Optional resize🧩 Ready-made snippets✓ Exact size metrics
IMGBASE64

Drop your image here

or click to choose PNG, JPEG, WebP, GIF or SVG

Choose imageProcessed locally · maximum 25 MB
Use Base64 deliberately

Best for small, self-contained assets

Inlining removes a separate request, but it increases text size and prevents the image from being cached independently.

Good candidates

  • Tiny icons and placeholders
  • Single-file HTML demos
  • Email experiments with tested clients
  • Small generated assets
!

Consider carefully

  • Frequently reused images
  • Content that changes often
  • CSS bundles shared across pages
  • Strict Content Security Policy
×

Avoid for

  • Large photos and banners
  • Video or large animations
  • Assets needing browser caching
  • User-generated untrusted SVG

Output formats explained

Data URI

Complete data:image/...;base64,... value for direct use in compatible attributes and CSS.

Raw Base64

Only the encoded payload, without MIME type or Data URI prefix.

CSS and HTML

Ready-to-paste declarations with escaped class and alternative-text values.

Convert an image in four steps

1

Choose

Open an image locally in the browser.

2

Configure

Preserve bytes or resize and change format.

3

Convert

Generate the Base64 payload and snippets.

4

Use carefully

Copy the required form and monitor page size.

Frequently asked questions

Is my image uploaded?

No. File reading, optional resizing and Base64 encoding happen locally. Only the usage request is sent when Convert is pressed.

Why does Base64 add roughly 33%?

Every three bytes are represented by four text characters, with small additional cost for padding and the Data URI prefix.

Does resizing preserve metadata or animation?

No. Canvas transformation creates a new static raster image and removes metadata. Original bytes mode preserves the exact source file, including GIF animation and metadata.

Can I embed SVG as Base64?

Yes in Original bytes mode, but do not embed untrusted SVG because SVG can contain active or external content in some usage contexts.

Why might a Data URI be blocked?

Content Security Policy, email-client rules, browser limits or the target application may disallow data URLs.