Base64 and Data URI Converter

Convert an image to Base64 or a data URI, get the image back from Base64 code, turn an SVG into CSS and encode or decode text, right in your browser.

Drag an image here or click to choose oneJPG, PNG, WebP, GIF, SVG, ICO… · 10 MB max · you can also paste an image (Ctrl+V)

Base64 makes a file about a third heavier: keep it for small images and icons.

Everything is computed in your browser: nothing is uploaded.

Free · no sign-up

About this tool

The Base64 converter brings together five conversions useful to developers and web designers: image to Base64, Base64 to image, SVG to CSS, CSS to SVG, and text encoding or decoding. Use it, for example, to embed a small icon directly in a stylesheet or an HTML email.

Drop or paste an image to get its data URI, the bare Base64, a CSS background-image rule, an img tag or Markdown. Paste Base64 code to get the image back: its format is detected automatically. For SVG, minimal URL encoding gives shorter, readable code than Base64.

  • Image to Base64: data URI, bare Base64, CSS, HTML or Markdown
  • Base64 to image with format detection (PNG, JPG, GIF, WebP, SVG, ICO, AVIF…)
  • SVG to CSS with minimal URL encoding or Base64
  • Recover the SVG hidden in a CSS rule
  • Text to Base64 and back, in UTF-8, with a URL-safe option
  • No upload: everything happens in the browser

How to use it

  1. Choose the tab for the conversion you need.
  2. Drop an image, paste a code or an SVG.
  3. Choose the output format.
  4. Copy the result or download the file.

Frequently asked questions

What is a data URI?

It is an address that contains the file itself, for example data:image/png;base64,…: the image displays without a request to a server.

Should I convert everything to Base64?

No: Base64 makes a file about a third heavier and it is not cached separately. Keep it for small images and icons.

Why URL encoding for SVG?

An SVG is already text: escaping only the necessary characters gives code that is shorter than Base64 and stays readable.

Are my files uploaded?

No, every conversion happens in your browser.

Related tools

See all 57 free tools →