Image to Base64 Converter

Drop an image, paste, or pick a file — get a base64 data URL ready to paste into HTML, CSS, or JSON. Or go the other way: paste a data URL to preview the image.

What is base64 encoding?

Base64 turns binary data into a string of 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It's how you embed images, fonts, and other binary in text-only contexts: email (MIME), JSON, CSS url(), HTML img src attributes, JWT payloads.

The size cost is ~33% — base64 needs 4 characters for every 3 bytes. So a 30 KB image becomes ~40 KB of base64 text.

When to inline images as data URLs

When NOT to inline

Privacy

Encoding and decoding both run entirely in your browser. The image is processed via the FileReader API and base64 is computed locally — nothing is uploaded or logged anywhere.