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

Updated:

PNG to XML Converter: Trace PNG to SVG

Use this PNG to XML converter to trace a PNG, JPG or WebP into an SVG, which is a vector image written in XML. Choose colour or black and white, check the preview and download the file. Nothing is uploaded.

Processing in browser...

Loading the tool. It runs entirely in your browser, so your data is never uploaded.

More free tools you may need next.

Quick Guide

How to use PNG to SVG

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

  1. 01

    Add your image

    Drop a PNG, JPG, WebP, GIF or BMP file on the left, or press Ctrl+V to paste an image from your clipboard. The Sample button loads a small logo so you can see how the trace looks first.

  2. 02

    Pick the style

    Choose Colour for logos, icons and flat artwork, then set how many colours to keep. Choose Black & white for line art, stamps and signatures, then move the threshold until the shapes look right.

  3. 03

    Tune detail and specks

    Detail sets the size the image is traced at. Higher detail follows small features but takes longer and makes a bigger file. Speck removal drops tiny blobs left by noise. Smooth curves turns jagged edges into curves while keeping sharp corners.

  4. 04

    Check the preview and download

    The SVG preview updates as you change an option. Press Download .svg to save it or Copy SVG to paste the code. The swap button sends the SVG to SVG to PNG if you want to turn it back into an image.

How This PNG to XML Converter Works

An SVG file is a vector image written in XML. A PNG is a grid of pixels. Going from the grid to the XML means finding the outlines of the shapes in the picture and writing them as paths, which is called tracing or vectorizing. That is what this png to xml converter does, in your browser tab.

  1. The image is scaled to the detail size you chose and its pixels are read.
  2. In colour mode the tool finds the main colours with a median-cut palette and gives every pixel to its nearest colour. In black and white mode pixels darker than the threshold become ink.
  3. For each colour it follows the edges between pixels to get closed outlines, and drops outlines smaller than your speck setting.
  4. The outlines are simplified so a straight edge becomes one segment instead of hundreds of steps, then written as SVG paths with smooth curves where the edge is curved and sharp corners where it is not.
  5. Colours are stacked from the largest to the smallest, so no gaps show between neighbouring shapes.

What Traces Well and What Does Not

  • Works well: logos, icons, badges, simple illustrations, flat colour graphics, stamps, signatures and black line art with clear edges.
  • Works with care: scanned drawings and screenshots. Use black and white mode, raise the threshold until thin lines stay solid and use speck removal for scanner noise.
  • Not suited: photographs. Tracing a photo with a few colours gives a poster-like picture, and with many colours gives a very large file. Keep photos as JPG or WebP.

The result can only be as good as the source. Start from the largest, cleanest version of the image you have. A tiny, blurry or heavily compressed JPG has edge noise that tracing will faithfully copy.

PNG to SVG, Android XML and Other Meanings of XML

People who search for png to xml, image to xml or convert picture to xml usually mean one of two things. The first is an SVG, because SVG is an XML format for graphics. That is what this tool produces. The second is the XML vector file used inside Android apps, called a vector drawable.

To get an Android file, trace the image here, download the SVG and paste it into SVG to XML, which writes an Android vector drawable. To go back the other way, XML to SVG turns an Android vector drawable into a normal SVG. A plain PNG cannot be turned into other kinds of XML data, because pixels hold no text or structure to extract.

Why Use a Vector Instead of a PNG

  • Sharp at any size: the same file works as a favicon and as a banner or print.
  • Small files for simple art: a flat logo is often a few kilobytes as SVG.
  • Editable: change colours and shapes in Figma, Illustrator or Inkscape, or style them with CSS on a web page.
  • Cutting and printing: sign makers, laser cutters and embroidery tools ask for vector paths.

To check the result as a pixel image, send it to SVG to PNG with the swap button. Both tools run entirely in your browser.

Frequently Asked Questions

Technical Q&A for PNG to SVG

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

No. The image is read and traced inside your browser tab. Nothing is sent to ToolPlank or anyone else.

Yes. The tool finds the outlines of the shapes and writes them as SVG paths. It does not embed your PNG inside an SVG. It is still an automatic trace, so complex images will not match the original exactly.

Trace the PNG here to get an SVG, then open SVG to XML to turn it into an Android vector drawable. Android vector drawables do not support gradients or text, so keep the artwork to flat shapes.

Tracing groups pixels into a small number of flat colours. That suits logos and icons, but a photograph has millions of colours. Raise the colour count for more detail, or keep photos as JPG or WebP.

PNG files with a transparent background stay transparent. For a picture with a white background, switch on Remove white background in colour mode, or use black and white mode, which only draws the dark shapes.

Very busy images can create hundreds of thousands of points, which would make a huge SVG that is slow to open. Lower the detail, use fewer colours or remove more specks.