Images TOOL

Image → Base64

Convert an image to a data URL that you can copy.

01

Choose your files

On-device processing
02

Output options

No account. No uploads.

Image → Base64 · How to use

Convert an image to a data URL that you can copy.

Example

Select a PNG image to create a data:image/png;base64,... string.

Things to know

Base64 is typically about one third larger than the original binary. Large images produce large strings.

Choose files: PNG · JPG · JPEG · WEBP

Your files and results are never sent to a server. Everything is processed in this browser.

How to turn an image into a Base64 string for HTML or CSS

Use it to embed a small icon directly in HTML or CSS without a separate file, or to send an image inside a JSON request. The tool checks the file's actual content and adds the matching image/png, image/jpeg or image/webp prefix.

When to use this tool

  • Embed a small icon in a CSS background as a data URL
  • Include an image directly in an HTML email template
  • Send an image as a string in a JSON request body

Step-by-step instructions

  1. Select a PNG, JPG or WebP image.
  2. Choose Convert.
  3. When the data:image/png;base64,... string appears in Result text, choose Copy.
  4. To keep a long string as a file, download image-base64.txt.

Frequently asked questions

How much larger does Base64 make an image?

Base64 is typically about one third longer than the original. A 30 KB image becomes a string of roughly 40 KB. Shrink large images before converting.

How do I use the result in HTML?

Paste the whole string as the src of an img tag or inside url() in CSS. Keep the data:image/...;base64, prefix so the browser recognizes it as an image.

Is there a file size limit?

PNG, JPG and WebP images up to 6 MB can be converted. Reduce larger photos with the image resizer and try again.

Save only the tools you need.