Loading Base64 to SVG Converter...

How to Convert Base64 to SVG

SVG ends up as Base64 whenever an icon has to live inside something else: a CSS background, an email template, a JSON field. Because SVG is text, decoding gives you back real, editable vector markup rather than a bitmap.

Step 1

Paste the Base64 or data URI

Paste the Base64 string, or the whole data:image/svg+xml URI copied from your CSS, into the input panel. The Sample button loads a small gradient badge.

•
Raw Base64: plain Base64, wrapped over several lines or the URL-safe kind
•
Data URI: data:image/svg+xml;base64,… or the text form data:image/svg+xml;utf8,<svg…> from CSS
•
Quoted values: a string copied out of code or JSON with its quotes still on
Step 2

Check the preview and the markup

A moment after you paste, the drawing appears in a sandboxed preview with the SVG source underneath. Broken Base64, a cut-off string or data that is not SVG gets a message saying what went wrong.

•
Preview: the drawing is shown with scripts switched off, so a hostile SVG can't touch this page
•
Source: the SVG markup, colour-coded and exactly as encoded; to re-indent it, paste it into the XML Formatter
•
Well-formedness check: if the XML is broken, a note gives the line and column of the first problem
Step 3

Copy or download the SVG

Copy the markup to your clipboard, or download decoded.svg, which holds the decoded bytes exactly as they were.

•
Edit it: open decoded.svg in Inkscape, Illustrator or a text editor
•
Shrink it: run it through the SVG Optimizer, or turn it into a React component with SVG to JSX
•
Encode it again: after editing, SVG to Base64 gives you a fresh data URI

Frequently Asked Questions

Where do Base64-encoded SVGs usually come from?

Mostly from CSS and HTML. Icons are often inlined as background-image: url("data:image/svg+xml;base64,PHN2Zy…") so a page needs one request fewer, and the same strings turn up in email templates, JSON API responses, design-token files and database columns. A Base64 string that starts with PHN2Zy is almost always SVG: that is how <svg looks once encoded, and PD94bWwg is the <?xml declaration some editors put in front of it.

Which input forms does it accept?

Plain Base64, Base64 broken over several lines, URL-safe Base64 with - and _ and no = padding, a value still wrapped in quotes from code or JSON, and data URIs. Both kinds of data URI work: data:image/svg+xml;base64,… and the text form used in CSS, data:image/svg+xml;utf8,<svg…> or its percent-encoded version with %3C and %3E.

Does decoding change the SVG in any way?

No. The markup is shown exactly as it was encoded: no re-indenting, no tidying of attributes, numbers like 14.50 or 00501 left as written, comments and line endings kept. Download saves the decoded bytes themselves, so a byte-order mark or Windows line endings come through unchanged.

Is it safe to preview an SVG I got from somewhere else?

An SVG can carry scripts, event handlers like onload, embedded HTML and javascript: links. The preview draws it inside a locked-down frame where scripts are switched off and nothing can reach this page or redirect it; links inside the drawing open in a new tab. The source panel is read-only text and is never run.

Why does it say my data is not an SVG?

The Base64 decoded fine, but there is no <svg> element in it. The message tells you what it found instead: a PNG or JPEG image (use Base64 to Image), JSON, an HTML page, other XML, plain text, or a binary file such as a PDF or a gzip-compressed .svgz. If the SVG is there but has a mistake, such as a tag that is never closed, you still get the markup along with a note naming the line and column of the first problem.

Does my SVG leave the browser?

No. Decoding happens in JavaScript on this page, nothing you paste is uploaded or kept, and a reload starts with an empty editor. Keep in mind that Base64 is only an encoding, not encryption: anyone with the string can read the SVG.