↑↓ to move ↵ to open Esc to close Browse all tools

PNG to SVG Converter

Trace a PNG, JPG, WebP or HEIC image into an SVG made of shapes, compare it with the original and download it. Nothing is uploaded.

Convert an image to SVG

Your image is traced by your own browser. Nothing is uploaded.

Hand-checked listFree Icon SetsOpen icon sets with the license, commercial use and credit rules checked at the source.

PNG to SVG Converter by Freebiefy, free online tools · Privacy · Legal notice

Embed this tool on your site

Paste this code into your page. The tool runs in the visitor's browser, free and without signup. The height adjusts to the content. All tools you can embed

From pixels to shapes

A PNG, JPG or WebP file is a raster image, also called a bitmap: a grid of pixels, each with one color. An SVG file describes shapes instead. MDN describes SVG as an XML-based markup language for two-dimensional vector graphics that can be rendered at any size without loss of quality. That is why logos and icons are often wanted as SVG: they stay sharp on a large screen, in print and when you scale them in a design program.

This converter traces a raster image to vectorize it: it finds areas of the same color and writes their outlines as SVG paths. The result is a real SVG with shapes you can recolor, scale and edit. For when to use which format, read SVG vs PNG. For the other direction, use SVG to PNG.

How the tracing works

The tracing is done by imagetracer.js, a public domain library by Andras Jankovics. The steps, as its process overview describes them:

  1. Reduce the colors. Every pixel is assigned to one of a small number of colors with a variant of k-means clustering. This tool picks the starting colors itself with a median cut over the image, so a small accent color in a logo still gets its own color.
  2. Separate the layers. Each color becomes its own layer, and the edges between pixels of that color and other pixels are found.
  3. Follow the edges. The edge points are joined into closed outlines.
  4. Fit lines and curves. Each outline is replaced by straight lines and quadratic curves that stay within the error tolerance. Where neither fits, the outline is split and tried again.
  5. Write the SVG. Each color layer becomes a group of paths. This tool writes the largest areas first and the small details on top.

What each setting changes

SettingWhat it doesTry
Number of colorsHow many color layers the image is reduced toThe real number of logo colors plus one for the background
Ignore specksDrops outlines shorter than this many edge pointsRaise it when dust or noise shows up as dots
Curve toleranceLargest allowed distance, in pixels, between the outline and the fitted line or curveLower for sharp detail, higher for smooth and small files
Blur before tracingBlurs the image with a radius of 1 to 5 pixels, but keeps pixels the blur would change a lot1 or 2 for JPEG files and scans
Trace sizeLongest side of the image while it is traced1,000 px, or 1,600 px for fine detail
Remove white backgroundLeaves out every color whose red, green and blue are all 230 or higherLogos on a white background

The presets set these values for you. Logo, flat colors uses 6 colors. Black and white line art puts transparent areas on white and sorts every pixel into black or white, which suits drawings, signatures and stamps. To choose where gray turns black, make the image black and white first with the black and white image converter. Detailed uses 32 colors and a lower tolerance, which keeps more of a photo but makes a much larger file.

Worked example, computed with this tool: a 60 × 40 pixel image with a red square and a small blue dot on white, traced with the Logo settings and 3 colors, gives 3 color layers: white, red and blue. With Remove white background on, only the red and blue layers remain and the rest of the SVG is transparent.

What tracing can and cannot do

Tracing works best on images that already consist of flat areas: logos, icons, clip art, signatures, stamps, line drawings and scans of printed graphics with high contrast. Use the largest and cleanest file you have. A blurry or tiny image gives blobby shapes.

A photo does not become a true vector drawing. Soft shading turns into bands of flat color, and texture turns into thousands of small shapes. Small text is traced as shapes, not as text you can edit, and pixel art loses its square corners. A traced photo is often larger than the original file, because every shape is stored as text with its coordinates.

Tracing time grows with the number of pixels and colors. To keep it practical, the image is traced at the trace size you pick, at most 1,600 pixels on the longest side, and the SVG is then set to the width and height of your original image. Small images are enlarged up to four times before tracing, which smooths the stair steps of their edges. Tracing runs in a background thread, so the page stays usable. Very large photos may not open at all on an iPhone or iPad because of their memory limits.

How to use the PNG to SVG converter

  1. 1Drop an image on the box or tap it to choose one. HEIC photos from an iPhone work too.
  2. 2Pick a preset, then adjust the number of colors, specks, curve tolerance and blur while you watch the SVG next to the original.
  3. 3Turn on Remove white background if the design should sit on a transparent background.
  4. 4Press Download SVG, or Copy SVG code to paste it into HTML or a design tool.

Sources and credits

Frequently asked questions

Is my image uploaded?

No. Your browser opens the image, traces it in a background thread on your device and saves the SVG there. Nothing is sent to a server.

Will a photo become a real vector drawing?

Not in the sense of a drawing made by hand. The tracer splits the photo into a fixed number of color areas and outlines each one. You get an SVG made of shapes, but soft shading turns into flat bands and fine texture into many small shapes. Logos, icons and line art trace much better than photos.

Why is my SVG larger than the PNG?

Every shape is stored as text with its coordinates. A detailed image with many colors can need thousands of shapes, which takes more space than the compressed pixels of a PNG. Use fewer colors, raise Ignore specks or Curve tolerance, or pick a smaller trace size to get a smaller file.

How do I get a transparent background?

Turn on Remove white background. Every color layer that is close to white is left out of the SVG, so the background becomes transparent. White parts inside the design, such as white letters on a colored badge, are removed too. A PNG that is already transparent keeps its transparency without this switch.

Which setting gives the cleanest logo?

Start with the Logo preset and set Number of colors to the number of colors your logo really has, plus one for the background. If the edges look jagged, use a larger trace size. If small dots or noise appear, raise Ignore specks or add a little blur.

Why is the image scaled before tracing?

Tracing time grows with the number of pixels and the number of colors, so a 12-megapixel photo could take minutes. The image is traced at the trace size you choose, at most 1,600 pixels on the longest side, and the SVG is then set to the width and height of your original image. Small images are enlarged up to four times first, which gives smoother curves.