SVG (Scalable Vector Graphics) is an image format that stores drawing instructions rather than a grid of dots. Because the browser redraws the shapes at whatever size is needed, an SVG logo looks equally crisp on a phone and on a 4K monitor, and the file is usually very small.
How an SVG draws itself
An SVG file is plain text written in XML, a markup language close to HTML. Inside are elements such as circle, rect and path, each with coordinates, fill colours and stroke widths. A viewBox attribute defines the drawing's own coordinate space, and the browser scales that space to fit the box on the page. No pixels are stored, so there is nothing to blur when enlarged.
Because it is text, an SVG can sit directly in a page's HTML, be styled with CSS (for instance changing an icon's colour on hover), be animated, and be compressed well by the server. The format is a W3C standard and every modern browser supports it.
Example: one logo file for every screen
A landscaping company has its logo as a 600-pixel PNG. It looks soft on high-density phone screens and blurry when the designer enlarges it for a banner. Asking the original designer for the vector source and exporting it as SVG gives one small file that is razor sharp everywhere. Icon libraries such as Lucide, Heroicons and Font Awesome ship their icons as SVG for the same reason.
When SVG is the wrong tool
SVG suits anything made of shapes: logos, icons, illustrations, simple charts and diagrams. It does not suit photographs. Tracing a photo into vectors creates thousands of paths and a file far larger than a JPEG. For photos use a raster format, and for a logo with fine photographic texture a PNG may still be better.
Where SVG goes wrong in practice
- Uploading SVGs from strangers. SVG can contain scripts, so allowing untrusted users to upload SVGs that your site then serves is a known cross-site scripting risk. Sanitise them or only accept files from your own team.
- Exporting with editor junk. Design tools often leave metadata, hidden layers and excessive decimal places. A tool like SVGO strips this and can cut the size substantially.
- Text that depends on a font. If the SVG uses live text in a font the visitor lacks, it renders in a fallback. Convert logo lettering to outlines before export.
- Missing accessible names. Give meaningful SVGs a
titleor an aria-label, and hide purely decorative ones from screen readers.