SVG to Data URI

Encode SVG for img src, CSS url() or anywhere a URI fits.

or drop a file / paste code below
Data URI
Output appears here

How it works

  1. 1Paste SVG code or drop an .svg file.
  2. 2Choose URL-encoded (smaller) or base64 encoding.
  3. 3Copy the data URI for use in HTML, CSS or markdown.

Free, no signup, no watermark — everything runs locally in your browser, so your files never leave your machine.

Frequently asked questions

URL-encoded vs base64 — which is better?

URL-encoded is typically 20–30% smaller for SVG and stays readable. Base64 is safer inside strict parsers.

Related tools