What is SVG? | Glossary

Glossary

What is SVG?

SVG is a vector image format that describes shapes as code instead of pixels, so logos and icons stay perfectly sharp at any size with tiny file sizes.

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 title or an aria-label, and hide purely decorative ones from screen readers.

Related terms

  • PNG: the raster fallback when no vector exists.
  • Pixel: what raster formats store and SVG does not.
  • Favicon: modern browsers accept SVG favicons.
  • CSS: can recolour and animate inline SVG.

Ready to put this into practice?

We.Inc lets you describe a site in chat and watch AI build it live, then refine it visually or in code.

Start Building

Create your website for free, no card needed

Describe your business. Get a website ready to publish.

Ready to simplify everything?

Join 15,000+ businesses that replaced their entire marketing stack with one platform.

create your website for free, no card needed · Talk to sales

Product

Who It's For

Features

Resources

Company

View Sitemap