Skip to content
LovTools
EN

SVG to Data URI

Convert SVG markup into a data URI for CSS backgrounds or <img> tags.

Processed locally on your device — nothing is uploaded.

About the SVG to Data URI

Small icons and patterns can live directly in your CSS as data URIs, saving a network request. This tool converts SVG markup into a data URI using minimal URL encoding (smaller and still readable) or Base64.

Get just the URI, a ready background-image declaration or an <img> tag. Double quotes are turned into single quotes so the result can sit inside url("…").

How to use the SVG to Data URI

  1. Paste SVG markup.
  2. Choose URL-encoded or Base64, and the output form.
  3. Copy into your CSS or HTML.

Features

  • Batch files: run the tool on up to 200 files with the same settings and download every result as one ZIP
  • Minimal URL encoding
  • Base64 option
  • CSS, URI or <img> output
  • Character count

Supported formats

  • Plain text

Frequently asked questions

Why is URL encoding better than Base64?

Base64 makes files about 33% larger, while minimal URL encoding usually keeps SVGs smaller and gzip-friendly.

Is my text sent anywhere?

No. Everything runs in your browser, so nothing you paste is uploaded or stored.

Added · Last reviewed · Maintained by Sohail Khax · How we test tools