GameParticles
Images

SVG vs PNG: Vector or Raster for Logos, Icons and Photos?

SVG vs PNG explained: SVG is a vector format that scales to any size, PNG is a fixed grid of pixels. See when each wins for logos, icons, photos and favicons.

Updated

SVG is a vector format and PNG is a raster format. An SVG describes shapes with coordinates, so it stays perfectly sharp at any size and is usually tiny for simple artwork. A PNG stores a fixed grid of pixels, so it handles any kind of image but blurs when enlarged. Use SVG for logos, icons and illustrations, and PNG for screenshots, detailed images and anywhere SVG is not accepted.

Vector vs raster

A raster image is a grid of colored pixels. A 512 x 512 PNG contains 262,144 pixels and nothing else. Show it at that size and it is exact. Show it at 2048 x 2048 and the software has to invent fifteen new pixels for every original one, which is where blur and jagged edges come from.

A vector image is a set of drawing instructions. An SVG file is text, written in XML, with lines such as "a circle at this position with this radius and this fill". The browser redraws those instructions at whatever size is asked for, so the result is as sharp at 16 pixels as at 16,000.

That difference drives everything else in the comparison.

SVG vs PNG at a glance

SVGPNG
TypeVector, XML textRaster, pixel grid
ScalingSharp at any sizeSharp only up to its pixel dimensions
File sizeDepends on shape complexityDepends on pixel dimensions and detail
TransparencyYesYes, full alpha channel
AnimationYes, with CSS or built-in animationNo (APNG extension only)
Editable in codeYes, colors and shapes via CSS and JavaScriptNo
PhotosUnsuitableWorks, though large
Browser supportAll browsersAll browsers
Accepted by social media, email, app storesRarelyAlmost always

When SVG wins

Logos. A logo is used at dozens of sizes, from a browser tab to a conference banner. One SVG covers all of them. A simple logo is often 1 to 5 KB as SVG, smaller than a single PNG export at a moderate size.

Icons. Interface icons are simple shapes that need to be crisp on every screen density. SVG icons also inherit color: set fill="currentColor" and the icon follows the text color, including hover and dark mode states, with no extra files.

Illustrations with flat color. Spot illustrations, diagrams, charts and maps made of shapes are compact as SVG and scale with the layout.

High-density screens. A PNG needs 2x and sometimes 3x versions to look sharp on phones and Retina displays. An SVG needs nothing.

When PNG wins

Photos and photographic detail. An SVG can only describe a photo by tracing it into thousands of shapes, which is larger and worse. Photos belong in JPG, WebP or AVIF. PNG is the option when a photo-like image needs lossless quality or transparency.

Screenshots. A screenshot is pixels by nature. PNG stores it exactly.

Complex artwork. File size in SVG grows with the number of points and effects. A detailed illustration with gradients, shadows and textures can be several megabytes as SVG and slow to render, while a PNG of the same artwork has a fixed cost.

Places that reject SVG. This is the most common practical reason. Typical cases:

  • Social media profile pictures and post images.
  • Link preview images set with og:image.
  • HTML email, where support for SVG across mail clients is poor.
  • App store icons and the Apple touch icon for iOS home screens, which must be PNG.
  • Many content management systems and upload forms, which block SVG by default.

That last restriction exists for a reason. An SVG file can contain scripts, so an SVG from an untrusted source is closer to a web page than to an image. Only upload and embed SVGs from sources you trust.

Logos: keep both

The working rule is to treat the SVG as the master and PNG as an export.

  1. Get the vector original from the designer, as SVG, AI, EPS or PDF. If you only have a PNG, ask. Tracing a PNG back to vector is a last resort.
  2. Use the SVG directly on your website.
  3. Export PNGs for each place that needs one, at the exact size required or larger.
  4. Export at twice the display size for anything shown on screens. A logo displayed at 200 pixels wide should be a 400 pixel PNG.

When you need a PNG at a different size and only have a larger PNG, scale it down, never up. The Image Resizer takes PNG, JPG, WebP and GIF files, resizes to exact pixel dimensions with the aspect ratio locked, and exports PNG, JPEG or WebP. It works on raster files. To change the size of an SVG, no tool is needed, since the file scales by itself.

Icons and favicons

Favicons are the clearest case of needing both. Modern browsers can use an SVG favicon, but support is not universal, and several required icons are raster by specification. A complete set still includes:

FileSizeUsed by
favicon.ico16, 32 and 48 pxBrowser tabs, bookmarks, legacy browsers
favicon-32x32.png32 pxBrowser tabs on high-density screens
apple-touch-icon.png180 pxiOS home screen
android-chrome-192x192.png192 pxAndroid home screen
android-chrome-512x512.png512 pxAndroid splash screen, PWA install

The Favicon Generator produces exactly that set. Drop in your logo as SVG, PNG, JPG or WebP and it renders every size, with options for a transparent or colored background, square, rounded or circular corners, and padding. The download is a ZIP containing the icons, a site.webmanifest and the HTML snippet for your page head. Starting from the SVG gives the cleanest result, because each size is drawn fresh from the vector shapes.

File size: neither always wins

Simple shapes favor SVG heavily. A two-color icon might be 600 bytes as SVG and several kilobytes as a PNG at a useful size.

Complexity reverses it. As a rough test, open the SVG in a text editor. If it is a few dozen lines, SVG is the right format. If it is thousands of lines of path data, or contains a long block of encoded characters, which means a raster image has been embedded inside it, a PNG or WebP will be smaller and faster.

If you must ship PNGs, the Image Compressor re-packs them losslessly or converts them to WebP for a smaller file.

Converting between them

SVG to PNG is easy and exact. Design tools such as Figma, Illustrator and Inkscape export any size you choose. Export large, then scale copies down in the Image Resizer as needed.

PNG to SVG is not a real conversion. Tracing software estimates shapes from pixels, which is acceptable for a clean black and white logo and poor for anything subtle. The dependable fix is to find the original vector file.

For how PNG compares with other raster formats, see JPEG vs PNG and the overview of image file formats. Related utilities are in the images category.

Try it

Drop your SVG logo into the Favicon Generator and look at the 16 pixel preview. If the mark is unreadable at that size, add padding or use a simplified version, then download the full icon package.

Tools in this guide

Frequently asked questions

Is SVG better than PNG for logos?

Yes, when you have the vector source. An SVG logo stays sharp at every size from a favicon to a billboard, is usually only a few kilobytes, and can be recolored with CSS. Keep PNG exports for places that do not accept SVG.

Can I convert a PNG to SVG?

Only by tracing, where software guesses shapes from the pixels. It works reasonably for simple, high-contrast logos and badly for photos. Wrapping a PNG inside an SVG file does not make it a vector. Ask for the original vector file first.

Why does my PNG look blurry when I enlarge it?

A PNG has a fixed number of pixels. Enlarging it makes the software invent the pixels in between, which softens edges. Export the PNG at the largest size you need, or at twice the display size for high-density screens.

Does SVG support transparency?

Yes. An SVG has no background unless you draw one, so anything not covered by a shape is transparent. Individual shapes can also be partly transparent using the opacity, fill-opacity and stroke-opacity properties.

More images guides

JSON Formatter
Developer · Format, validate and minify JSON with syntax highlighting.
↵
Base64 Encode / Decode
Developer · Encode text to Base64 or decode Base64 back to plain text.
↵
URL Encoder / Decoder
Developer · Encode or decode URL components and query strings.
↵
Hash Generator
Developer · Generate MD5, SHA-1, SHA-256 and SHA-512 hashes.
↵
UUID Generator
Developer · Generate UUIDs v4 (random) in bulk with one click.
↵
Regex Tester
Developer · Test regular expressions against text with live match highlighting.
↵
Word Counter
Text · Count words, characters, sentences, paragraphs and reading time.
↵
Case Converter
Text · Convert text between UPPER, lower, Title, camelCase, snake_case and more.
↵
List Sorter
Text · Sort, reverse, deduplicate and shuffle lists of text.
↵
Markdown Preview
Text · Write Markdown and see a live rendered preview side by side.
↵
Percentage Calculator
Numbers · Calculate percentages, increases, decreases and what % one number is of another.
↵
Color Converter
Colors · Convert colors between HEX, RGB, HSL and HSV instantly.
↵
Snake
Arcade · Eat food, grow longer, don't hit the walls. A timeless classic.
↵
2048
Puzzle · Slide tiles and combine them to reach the legendary 2048 tile.
↵
Word Grid
Puzzle · Guess the hidden five letter word in six tries using color clues.
↵
Sudoku
Puzzle · Fill the 9x9 grid with logic. Four difficulties from easy to expert.
↵
Minesweeper
Strategy · Use number clues to clear the minefield. Classic logic, three levels.
↵
Breakout
Arcade · Smash every brick with paddle and ball. Power-ups, combos, endless levels.
↵
Typing Practice
Casual · Build your WPM and accuracy with timed drills from 30 seconds to 5 minutes. Find your weak keys.
↵
TypeRunner
Arcade · Multiplayer typing race. Race friends by link, beat computer runners, or chase your own ghost.
↵
Typing Blocks
Arcade · Type each word before its wooden block lands. Miss, and the pile climbs toward the line.
↵
Bubble Shooter
Arcade · Aim, bank shots off the walls, and pop groups of three or more bubbles.
↵
Road Rush
Arcade · Race seven rivals through traffic and punch your way to the front.
↵