Skip to content
empinet.dev
Images & Codes

Image to Base64 Converter

Convert PNG, JPG, WebP, or GIF images to Base64 online without uploading them. Preview your image and copy either the raw Base64 string or a complete image data URL for HTML and CSS.

Encode an image

Up to 10 MiB. Files are read locally, not uploaded.

Image preview

Choose an image to see its preview and encoded output.

Encoded output appears here.

Encoding preserves the original bytes, metadata, and animation. Base64 is not compression or encryption. Use small images for inline data URLs; large images are usually better served as separate files.

PNG, JPG, WebP, and GIF to Base64

Choose an image up to 10 MiB. The converter reads its binary bytes directly and encodes them as standard Base64. It does not resize, compress, or convert the image format. GIF and WebP animation, transparency, and embedded metadata remain in the encoded bytes. File signatures and MIME types are checked, but this is not a full image-integrity validator. SVG, AVIF, HEIC, and ICO files are not supported.

Base64 versus an image data URL

Raw Base64 contains only the encoded bytes. A data URL adds the image MIME type and the base64 marker, such as data:image/png;base64,. Use the full data URL as an HTML image source or inside CSS url(). Use Base64-only output when a JSON field or API specifically expects the encoded payload without that prefix.

<img src="data:image/png;base64,..." alt="Example image" />
background-image: url("data:image/png;base64,...");

The ellipsis is a placeholder: replace it with your complete encoded output.

Does Base64 make an image smaller?

No. Base64 uses four characters for every three input bytes, rounded up, so the payload is roughly one-third larger before any transport compression. A data URL adds a small prefix. Inlining may be convenient for small icons or self-contained documents, but large images make HTML or CSS heavier and cannot be cached independently of their containing resource. Compress or resize the image first when file size matters.

Private processing, not encryption

File reading, encoding, and previewing happen on your device. This tool does not upload or persist your image. Base64 can be decoded by anyone who receives the string, and original metadata is preserved: remove sensitive metadata before sharing. Data URLs may be blocked by a destination site’s content security policy, and applications have their own payload limits. Browser clipboard permissions or large outputs may require copying manually from the output field.