SVG is a vector image format. Instead of storing a grid of pixels, an SVG file is a text document, written in XML, that describes shapes: lines, curves, circles, text and fills. The viewer draws those shapes fresh at whatever size is needed, so an SVG is perfectly sharp at 16 pixels or 16 metres. SVG became a W3C standard in 2001 and every modern browser supports it.
What SVG is good at
- Logos and icons. One file looks crisp on every screen density and size.
- Small files for simple graphics. A logo can be a few kilobytes, smaller than any PNG of it.
- Editable and stylable. Because it is text, colours and shapes can be changed with code or CSS, and SVGs compress well with gzip.
- Charts, diagrams and maps that need to scale and stay readable.
Where SVG falls short
- Photos. Describing a photo with shapes is impractical; photos belong in JPG, WebP or AVIF.
- Acceptance. Social networks, email clients, office programs, marketplaces and many upload forms don’t accept SVG.
- Fonts and linked files. Text in an SVG relies on fonts being available unless they are embedded or converted to outlines, and linked images may not load.
SVG and security
An SVG can contain scripts and links, because it is a full web document. When a website shows an SVG as an image, browsers disable scripts and external loading, so it can’t run code. Opening an untrusted SVG directly in a browser tab is different: scripts can run there. For this reason, many platforms refuse SVG uploads, and converting to PNG is the safe way to share a vector graphic.
Common SVG conversions
Convert SVG to PNG when a platform needs a regular image, choosing a larger scale for high-resolution screens or print. The PNG keeps the transparent background.