Skip to content
ToolPlankDEV
Image & SVG Tools
100% In-Browser Execution

Updated:

XML to SVG Converter Online

Convert XML to SVG in your browser. Paste an Android vector drawable and get a standard SVG with groups, colours, gradients and clip paths, or paste SVG that is saved as XML to tidy it. Nothing is uploaded.

Options:

XML

Input
0 chars · 0 lines

SVG

Ready
Processing in browser...
0 chars · 0 linesUpdates as you type

Processed on your device. Your text is not sent to our servers.

More free tools you may need next.

Quick Guide

How to use XML to SVG

Simple step-by-step instructions to get the exact output you need.

  1. 01

    Paste your XML

    Paste an Android vector drawable (a file that starts with <vector>) or SVG that is saved as an XML file. The Sample button loads a small vector drawable with a rotated group.

  2. 02

    Decide how much to clean

    For SVG input, Remove comments and editor data drops comments, Inkscape and Sodipodi tags and metadata. Leave it on for a lean file, or switch it off to keep everything.

  3. 03

    Read the notes

    If the XML uses something that cannot be drawn, such as a colour that points to an Android resource, a note at the top of the SVG lists it. Those colours are drawn with currentColor so you can set them with CSS.

  4. 04

    Copy or download the SVG

    Copy the SVG or download it as a .svg file. Use the swap button to send it back to SVG to XML, or open it in SVG to PNG to get an image.

How XML to SVG Conversion Works

XML is a general format, so an xml to svg converter can only draw XML that describes a drawing. The most common case is the Android vector drawable, the XML file inside an app's res/drawable folder. This tool reads that format and writes the same drawing as a standard SVG that opens in any browser, design tool or image viewer. If your XML is already an SVG, it is validated, given the right namespace and indented.

xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp" android:height="24dp"
    android:viewportWidth="24" android:viewportHeight="24">
  <path android:pathData="M12,2L2,7l10,5l10,-5z" android:fillColor="#4F46E5"/>
</vector>

That vector drawable becomes an <svg> element with a viewBox of 0 0 24 24 and one <path> with a fill of #4F46E5.

What Is Converted

  • Size: android:width and height in dp become the SVG width and height. The viewport becomes the viewBox.
  • Paths: pathData is copied as the SVG d attribute, with fill, stroke, width, caps, joins, miter limit, alpha and the even-odd fill rule.
  • Groups: translate, rotate, scale and pivot values become one transform that follows the same order Android uses.
  • Clip paths: a clip-path element clips the shapes that follow it in the same group.
  • Gradients: linear and radial gradients written with aapt:attr become SVG linearGradient and radialGradient elements. Sweep gradients are not supported by SVG.
  • Whole-icon alpha: android:alpha becomes the SVG opacity.

Cleaning SVG That Is Saved as XML

Design tools often save an SVG with a long header: an XML declaration, a DOCTYPE, comments, editor metadata and tags added by Inkscape or Sodipodi. These make the file bigger and harder to read. When the XML you paste is an SVG, the tool checks it is well-formed, adds the SVG namespace if it is missing, removes that clutter if you ask it to and writes it back with indentation.

It does not redraw or optimise the shapes, so the picture stays exactly the same. To use the cleaned file as an image, send it to SVG to PNG. To go the other direction and create an Android vector drawable, use SVG to XML. If you only have a bitmap, PNG to SVG traces it into a vector first.

What Cannot Be Converted

  • XML that is not a drawing, such as a sitemap, RSS feed or config file. There is nothing to draw, so the tool tells you what the file starts with.
  • Android animated vectors, shape drawables and layouts. Only the <vector> format is supported.
  • Trim paths and sweep gradients, which SVG cannot express the same way.

Frequently Asked Questions

Technical Q&A for XML to SVG

Common questions about edge cases, character encoding, and privacy guarantees.

No. The XML is parsed and converted in your browser tab. Nothing is sent to ToolPlank or anyone else.

Only XML that describes a drawing. That means an Android vector drawable or an SVG saved as XML. Other XML, such as data feeds, has no shapes to draw.

Android vectors can use colours defined elsewhere in the project, such as @color/brand. This tool only sees the pasted file, so it cannot look them up. currentColor lets you set the colour with CSS or the text colour.

Yes for linear and radial gradients and for clip paths. Sweep gradients and trim paths have no direct SVG equivalent and are listed in a note at the top.

Use SVG to XML. It writes a <vector> file from your SVG, and lists anything Android cannot hold.