Search DevFox

Search tools and pages.

Base64 to SVG Converter

Decode a Base64 SVG data URL back into the original XML and preview it safely in the browser

Loading tool...

What is Base64 to SVG Converter

Written by Giorgos Kostas. Last reviewed:

SVG is an XML-based vector format. Base64-encoded SVGs are common in CSS `background-image` rules and email templates; decoding restores the original XML so you can edit or inspect it.

Base64 to SVG Converter takes a data URL (`data:image/svg+xml;base64,…`) or raw Base64, decodes the bytes as UTF-8, and gives you the XML markup and a downloadable .svg file.

Why use it

  • Inspect or edit an SVG that is embedded as Base64 inside stylesheets or emails.
  • Extract icons from design systems that ship their sprite as a Base64 payload.
  • Share the original vector markup instead of the encoded blob.
  • 100% browser-based — nothing is uploaded.

Features

  • UTF-8 XML output
  • Downloadable .svg
  • Rendered SVG preview before download
  • SVG decoded on-device
  • Handles data URL or raw Base64
  • Whitespace-tolerant input

How to use Base64 to SVG Converter

  1. Paste Base64. Paste a `data:image/svg+xml;base64,…` string or raw Base64.
  2. Decode. Click Decode to SVG — the XML markup is rendered in the preview.
  3. Download. Click Download SVG to save a .svg file.

Example (before/after)

Base64 data URL

data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PGNpcmNsZSBjeD0iOCIgY3k9IjgiIHI9IjciIGZpbGw9IiMzYjgyZjYiLz48L3N2Zz4=

Decoded SVG markup

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><circle cx="8" cy="8" r="7" fill="#3b82f6"/></svg>

Common errors

Input is URL-encoded, not Base64

Some inline SVGs use `data:image/svg+xml;utf8,…` which is URL-encoded, not Base64.

Fix: Strip the `data:image/svg+xml;utf8,` prefix and URL-decode it separately — this tool handles Base64 only.

Scripts inside the SVG

Decoded SVG may contain `<script>` blocks. Most browsers disable scripts in images, but be careful when pasting untrusted SVG into a DOM.

Fix: Inspect the decoded markup before inlining it into your page, and consider running it through an SVG sanitizer.

FAQ

Does it produce plain XML?

Yes. The output is UTF-8 text that you can paste directly into a .svg file or an `<svg>` tag.

Is my data uploaded?

No. Decoding happens in your browser.

Can I decode the URL-encoded SVG form?

No — this tool decodes Base64 only. Use a URL decoder for the `…;utf8,…` variant.

Are scripts in the SVG sanitized?

No — decoding is byte-for-byte. Always sanitize untrusted SVG before inlining it.

Related tools

Related decoders and vector tools: You can also browse the full Image Tools category for more options.