How to Convert PNG to SVG (and When Not To)

PNG and SVG look similar on a screen, but they store images in very different ways. A PNG stores a grid of pixels. An SVG stores instructions for drawing shapes, lines, and curves. That difference decides when conversion makes sense. A simple logo with flat colors can become a small, sharp SVG that scales to any size. A photograph, with millions of colors and soft transitions, usually becomes a large, messy SVG that looks worse than the original PNG.

This guide explains the difference in plain language, shows how to convert a suitable PNG, and explains when to keep the PNG instead. It includes a worked example with a simple logo, a checklist for tracing, and the limits you should respect before you replace an image on a live site.

PNG Versus SVG: What Changes in Conversion

A PNG is a raster image. When you enlarge it beyond its original size, the pixels become visible and edges look soft or blocky. An SVG is a vector image. When you enlarge it, the browser redraws the shapes, so edges stay crisp. That is why SVG is popular for logos, icons, and simple illustrations that must look good on phones, large monitors, and printed pages.

Conversion is not the same as simply renaming a file. A converter must look at the pixels in the PNG and guess the shapes behind them. This process is called tracing or vectorizing. For a shape with a clear edge and one flat color, the guess is easy. For a shape with a gradient, a shadow, or a textured edge, the guess is harder. The converter may create many small shapes to approximate the effect, and the result can be larger and less clean than the PNG you started with.

That is why the best conversions start with the right source. A high-contrast PNG with clean edges, few colors, and no photographic detail is a good candidate. A low-resolution PNG with blurry edges is a poor candidate, because the converter cannot tell where one shape ends and another begins. If you have the original design file, use it instead. If you only have the PNG, accept that the result will be an interpretation, not an exact copy.

How to Convert a Suitable PNG Step by Step

Start by inspecting the PNG. Open it at full size and look at the edges. Are they sharp? Are the colors flat? Is the background transparent or solid? If the image has text, is the text large and simple, or small and detailed? A logo with a few bold shapes is a good starting point. A screenshot, a photo, or an image with many small elements is usually not.

Next, clean the PNG before you trace it. Crop away extra space. Remove any background you do not need. If the image has a white background that should be transparent, remove it in an image editor before tracing. Increase contrast slightly if edges look soft, but do not sharpen so much that you create halos or noise. Save a copy of the cleaned PNG. You will need it later if the SVG does not work out.

Then trace the image. You can use a vector editor such as Inkscape or Illustrator, or a reputable online converter. In a vector editor, the trace tool usually lets you choose how many colors to use and how closely the trace should follow the original. Start with a low number of colors. For a two-color logo, two or three colors are enough. A higher number may capture more detail, but it also creates more shapes and a larger file. Preview the result at several sizes before you accept it.

After tracing, simplify and check the SVG. Remove stray shapes, tiny dots, and unnecessary anchor points if your editor allows it. Compare the SVG with the PNG side by side at the size where it will be used. Check the edges, the corners, and any text. If the SVG looks close and the file size is reasonable, it is a good candidate. If it looks rough or the file is larger than the PNG, keep the PNG.

Worked Example: A Simple Logo

Imagine a simple logo saved as a PNG. It is a dark blue circle with a white star in the middle. The PNG is one thousand pixels wide, with a transparent background. The circle is flat, the star has straight edges, and there are only two colors. This is a good candidate for conversion.

First, you open the PNG and confirm that the circle edge is clean and the star points are sharp. You crop any extra transparent space around the circle. You keep the original PNG in a folder, because you may need it for places that do not support SVG. You then open the cleaned PNG in a vector editor and run the trace tool with two colors. The tool finds the circle and the star as separate shapes. You preview the result and see that the star points are slightly rounded. You adjust the trace settings to follow corners more closely, and the star becomes sharper.

Next, you export the traced result as an SVG and test it. You open the SVG in a browser and view it at a small size, such as thirty-two pixels wide, and at a large size, such as eight hundred pixels wide. At both sizes, the circle stays smooth and the star stays clear. You check the file size. The SVG is a few kilobytes, smaller than the PNG. You also check that the SVG scales without the pixelation you saw when you enlarged the PNG. In this case, conversion is a clear win.

Now imagine a different logo. It is the same circle and star, but with a soft drop shadow, a gradient in the circle, and small text around the edge. Tracing that version would be harder. The converter might create many shapes to approximate the shadow and gradient, and the small text might become unreadable. In that case, you would either simplify the logo first, keep the PNG, or recreate the logo as a vector from scratch. The worked example shows the pattern: simple shapes convert well, effects and small details do not.

Trace Carefully: Settings That Matter

Trace settings are not magic. They control how the converter groups colors and how closely it follows edges. A setting that smooths corners will make curves look cleaner but can round off sharp points. A setting that preserves corners will keep a star sharp but can make a curve look jagged. Try a few settings and compare the results. Do not accept the first output without looking at it.

Color count matters too. Fewer colors usually means a cleaner, smaller SVG. More colors can capture a gradient or a subtle change, but they also add complexity. For a flat logo, use the smallest number of colors that still looks right. For an illustration with a few flat colors, use a few more, but stop when adding colors stops improving the visible result.

Also check for background shapes. Some converters create a large rectangle for the background, even if the original PNG had a transparent background. That rectangle can cover other content or change the appearance on a colored page. If your SVG contains a background rectangle you do not want, remove it in the editor. Always open the SVG in a browser on a colored background to check that transparency survived the conversion.

When Not to Convert

Do not convert photos. A photo of a person, a landscape, or a product has too many colors and too much detail for a clean vector trace. The SVG will often be larger than the original photo, and it will still look like an approximation. A compressed JPEG or PNG is usually a better choice for photos. Use SVG for shapes, not for photographic detail.

Do not convert images with small text. Text in a PNG is made of pixels. When you trace it, the letters become shapes, and small letters can lose their form. The result may look blobby or uneven. If the text matters, keep the PNG, or recreate the text as real text in HTML or as a properly designed vector file. Do not rely on a trace to preserve readable small type.

Do not convert an image just because SVG sounds more modern. If the PNG is already small, sharp at the sizes you need, and easy to maintain, it may be the better choice. Conversion adds a step and a new file to maintain. It is worth doing when the image needs to scale, when the SVG is smaller, or when you need to change colors or shapes in code. It is not worth doing when the PNG already does the job.

Keep the Original PNG

Always keep the original PNG, even after a successful conversion. The PNG is your backup if the SVG does not display correctly in an older browser, in an email client, or in a tool that does not support SVG. It is also your source if you need to trace again with different settings. Store the PNG and the SVG together, with clear file names, so a future edit does not lose the source.

On a website, you can use the SVG as the main image and keep the PNG as a fallback in some cases, depending on your platform. Do not delete the PNG from your media library just because you uploaded an SVG. If a page stops showing the image, the PNG lets you restore it quickly. Treat conversion as adding a new version, not as replacing the only copy.

Also be careful with SVG files from untrusted sources. SVG files can contain scripts in some contexts, so only use SVG files you created or obtained from a trusted source, and follow your platform’s guidance for uploading them. If your site does not allow SVG uploads by default, do not work around that restriction without understanding the security implications. Use the PNG in that case.

Limitations: What Tracing Cannot Do

Tracing cannot recover information that is not in the PNG. If the PNG is blurry, the trace will be blurry in a different way. If the PNG has a low resolution, the trace cannot invent the missing edges. It can only guess. That guess may be close for simple shapes, but it will not be exact for complex ones.

Tracing also cannot preserve effects exactly. Gradients, shadows, glows, and textures are hard to represent as simple shapes. A converter may approximate them with many shapes, but the result can look different from the original and can be hard to edit. If those effects are important to the design, you may need to recreate them in a vector editor rather than tracing them.

Finally, tracing cannot decide what the image means. It does not know that a shape is a logo, a letter, or a face. It only sees color changes. That is why human review matters. You must check the result, simplify it, and decide whether it is good enough. A tool can do the tracing, but you must do the judging.

Frequently Asked Questions

Can I convert any PNG to SVG?

You can try, but the result will only be good for simple, flat, high-contrast images. Photos, screenshots, and images with small text or complex effects usually do not convert well. Keep the PNG in those cases.

Will an SVG always be smaller than a PNG?

No. A simple SVG is often smaller, but a traced photo or a detailed illustration can produce an SVG that is larger than the PNG. Compare file sizes after tracing, and use the format that is smaller and looks better at the sizes you need.

Should I delete the PNG after conversion?

No. Keep the original PNG as a backup and as a source for future traces. It is also useful as a fallback in places that do not support SVG well.

How do I know if my trace is good enough?

Compare the SVG with the PNG at the sizes where it will be used, check edges and text, and look at the file size. If the SVG looks clean, scales well, and is not larger than needed, it is a good result. If it looks rough or creates many stray shapes, try different settings or keep the PNG.

Convert PNG to SVG when the image is simple, flat, and needs to scale. Trace carefully, compare the result, and keep the original PNG. When the image is a photo or has small text and complex effects, the PNG is usually the better choice.