Module 1: Image formats and compressionLesson 6 of 255 min read
SVG vs PNG: vector and raster images explained
Two logos can look identical on screen and still behave very differently. Enlarge one for a banner and it stays crisp; enlarge the other and its edges turn soft and blocky. The difference is how the picture is stored: as a grid of pixels or as drawing instructions. Once you know which is which, it is clear when to keep an SVG, when a PNG is the right file, and which conversions make sense.
Raster: a grid of pixels
PNG, JPG, WebP, AVIF, GIF and HEIC are raster formats. The file records a colour for every pixel in a fixed grid, say 1200 by 800. Show it larger than that and the software has to stretch the pixels it has, which is why enlarged raster images look soft or blocky.
Raster is the natural way to store photographs, because a photo is made of countless small changes in colour and light that don't break down into neat shapes.
Vector: instructions for drawing
A vector image stores shapes instead of pixels: lines, curves, fills and text placed by coordinates. web.dev describes vector graphics as a set of instructions for how an image should be drawn. When the image is shown at a new size, the instructions are redrawn at that size, so edges stay sharp.
SVG (Scalable Vector Graphics) is the vector format of the web: an XML-based language developed by the W3C, so an SVG file is readable text. The Library of Congress notes that SVG 1.0 became a W3C Recommendation in September 2001.
Same circle, two ways
As raster, a red circle 500 pixels across is a grid of 250,000 pixels, sharp only up to that size. As SVG, it is about one line of text: a centre, a radius and a red fill. That line draws an equally sharp circle at 50 pixels or 5,000.
When SVG beats PNG
MDN calls SVG ideal for diagrams, icons and other images which can be accurately drawn at any size, and web.dev says interface icons are almost always well served by SVG. The same goes for logos, charts and line art built from sharp lines and solid colours.
- One file serves every size, from a tab icon to a poster.
- Simple shapes take far less space as instructions than as pixels.
- Colours and text stay editable.
When PNG or JPG is better
MDN notes that SVG is not generally useful for photographic images: a photo has no clean shapes to describe. Very detailed vector artwork also has a cost; web.dev warns it becomes a verbose set of instructions, a large file and more work for the browser to draw.
A raster copy is also the practical file when an image is used at one fixed size, or when a service asks for PNG or JPG. For choosing between those formats, see the guide on which image format to use.
Converting: one way is easy, the other isn't
SVG to PNG or JPG is straightforward: the instructions are drawn onto a pixel grid and that grid is saved. The result has the usual raster limits, so make it at least as big as you will show it.
The other direction isn't a real conversion. A photo contains only pixels. Saving it as SVG either wraps those pixels unchanged inside an SVG file, which gains nothing, or relies on tracing, where software guesses outlines and fills them with flat colour. Tracing can suit a simple logo, but it makes a new drawing, not a vector version of the photo. For a vector logo, go back to the original design file.
What the converter here does
The Image converter reads SVG and draws it to pixels, then saves JPG, PNG, WebP or AVIF. It cannot save SVG, because turning pixels into true vector shapes isn't possible. If you have both an SVG and a PNG of the same logo, keep the SVG as the master copy and make raster copies from it whenever you need a new size.
A security note on SVG
SVG is a document format and, as web.dev notes, can include JavaScript. The Library of Congress lists security concerns related to SVG images. MDN explains that when SVG is shown as an image, browsers may disable JavaScript and block external resources, but those limits don't apply when the file is opened directly as a page. Treat SVG files from unknown sources like any other document.
Need a PNG or JPG of a logo? Drop the SVG into the converter and pick the format, all in your browser.
Image converterQuick check
Three questions. Pick an answer to see why.
A logo looks blocky when enlarged for a banner. Why?
Show the answer
Answer: It is a raster image shown larger than its pixel size A raster image has a fixed number of pixels; enlarging it stretches them.
Why is SVG a poor choice for a holiday photo?
Show the answer
Answer: A photo has no clean shapes to describe, so it needs pixels SVG describes shapes; continuous detail is what raster formats are for.
A tracing tool saves your photo as SVG. What do you get?
Show the answer
Answer: A new drawing guessed from the photo Tracing invents outlines and flat fills; the photo's detail doesn't become shapes.
Rules change
File formats and official photo rules change. Each guide shows the date it was last checked; for forms and official photos, the authority's own page has the final word.
Sources
- MDN – Image file type and format guide
- web.dev – Vector images
- Library of Congress – Scalable Vector Graphics (SVG) 1.1
- MDN – SVG as an image
Last checked October 27, 2026