Skip to content
ToolFarmToolFarm
Image

Image to Base64

Convert an image to a Base64 data URL, or turn a Base64 string back into an image. Both ways, in your browser.

2 min read

Drop an image here

Choose an image to get its Base64 string.

What this tool does

Turn any image into a Base64 data URL you can paste straight into CSS, HTML or JSON, then go the other way and rebuild an image from a Base64 string. Both directions run in your browser, so your images are never uploaded. Switch between the two modes with the tabs.

Working with raw encoding? Encode any text with Base64, or change an image format first with Image converter.

What you can use it for

  • Embed a small icon directly in CSS or HTML as a data URL.
  • Inline an image inside a JSON payload or an email template.
  • Recover an image from a Base64 string you found in code.
  • Preview what a Base64 string actually contains.

How to use it

  1. Pick a direction: Image to Base64 or Base64 to Image.
  2. To encode, drop an image and copy the data URL.
  3. To decode, paste a Base64 string or data URL.
  4. Preview the result and download or copy it.

Everything runs inside your browser. No file is uploaded to any server. See more tools in this field.

Other tools people reach for in the same flow.

Image

Frequently asked questions

What is a Base64 data URL?

It is a way to embed a file directly in text, like data:image/png;base64,iVBORw0… Browsers treat it as a real image source, so you can inline small assets without a separate request.

Should I inline large images this way?

Usually not. Base64 makes data about a third larger and cannot be cached separately, so it is best for small icons. For big images, keep a normal file and link to it.

Are my images uploaded?

No. Encoding uses the browser's FileReader and decoding rebuilds the image locally. Nothing leaves your device, which is handy for private or unpublished images.

Why does my Base64 not show an image?

It may not be valid Base64, or it may not be image data at all. The tool checks the string and tries to detect the image type from its first bytes; if it cannot, it tells you instead of showing a broken image.

Image to Base64 · ToolFarm