What is SVG?
Short answer
SVG (Scalable Vector Graphics) describes an image as shapes and paths in XML text rather than a grid of pixels. Because it is math, not pixels, it stays sharp at any size, which makes it ideal for logos, icons, and illustrations.
Vectors, not pixels
PNG and JPG store a fixed grid of pixels, so enlarging them shows blur or blocky edges. SVG instead stores instructions, such as 'draw a circle here', which the browser renders crisply at any size.
<svg viewBox="0 0 100 100">
<circle cx="50" cy="50" r="40" fill="#2563eb" />
</svg>When SVG is the right choice
- Logos and icons that must stay sharp on every screen
- Illustrations and diagrams with flat colors and shapes
- Graphics you want to style or animate with CSS
- Tiny file sizes for simple shapes
When to avoid it
SVG is a poor fit for photographs. A photo has too much detail to describe as shapes, so it would produce a huge, complex file. Use JPG, WebP, or AVIF for photographs instead.