Image to Base64

Convert images to Base64 text and vice-versa. Useful for embedding images in code.

100% local processing. Your data never leaves your computer

About this tool

Image to Base64 converts images into Base64-encoded text — and also does the reverse, turning a Base64 string back into an image. This encoding format is widely used by developers to embed images directly into HTML, CSS, or JavaScript code, eliminating the need for a separate file request.

To encode, select an image and the tool immediately displays the corresponding Base64 string in Data URI format (e.g., `data:image/png;base64,...`). You can copy the full string with one click. To decode, paste a valid Base64 string and the corresponding image will be rendered, ready to download as a file.

Practical use cases: embedding small icons or logos directly in CSS stylesheets without extra HTTP requests, including images in HTML emails to ensure they display even without a working image server, storing images in databases as text within JSON or XML fields, and testing APIs that accept Base64-encoded images as payload.

The conversion runs entirely in the browser using the native JavaScript FileReader API. No files are sent to external servers, and no account or extensions are needed.

Frequently asked questions

Is it free?

Yes, completely free.

Are my images uploaded to a server?

No. Encoding and decoding happen entirely in your browser using the FileReader API.

Does it work on mobile?

Yes, on any smartphone or tablet with a modern browser.

What image formats can I encode?

Any image format supported by your browser: JPG, PNG, WebP, GIF, SVG, and others.

Does the Base64 string get very large?

Yes. Base64 increases file size by about 33%. It's best suited for small images like icons.