Skip to main content

What is an SVG file?

SVG (Scalable Vector Graphics) describes a picture as shapes, lines and text instead of pixels. The same small file looks sharp as a 16 px icon and on a billboard, as long as the picture really is made of shapes.

Key facts

Extensions
.svg
MIME type
image/svg+xml
First released
2001
Compression
Vector (stored as math)
Transparency
Yes
Animation
Yes
Shows directly in browsers
Yes
This site's converter
Read · Save

The short answer

Open an .svg file in a text editor and you'll see XML: tags like circle, path and text with coordinates and colors. The browser or image program reads those instructions and draws the picture at whatever size it's displayed, so there are no pixels to blur when you zoom in.

That makes SVG the natural format for logos, icons, diagrams, charts and simple illustrations. It's the wrong format for photos, which have no shapes to describe, only millions of slightly different pixels.

Measured: one badge, SVG vs PNG

The test graphic for these pages is a badge drawn directly as SVG: a blue circle and ring, a yellow star and a soft drop shadow, on a transparent background. Its source is 746 bytes. The PNGs below were rendered from that same file with sharp 0.35.5 (librsvg inside libvips 8.18.7).

Rendered as PNGSizeCompared with the SVG
64×643.0KB4×
256×25615.2KB21×
512×51235.1KB48×
1024×102487.1KB120×
2048×2048243.7KB334×

The SVG stays 746 bytes at every size. A PNG has to store every pixel, so it grows roughly with the area: doubling the width and height made it about 2.3–2.8 times bigger here.

What enlarging means for each:

Close-up of the star's top point. Left: the SVG drawn at 1024 px, with crisp straight edges. Right: a 64 px PNG of the same badge enlarged to 1024 px, with soft, blurred edges and a fuzzy ring

Making SVGs smaller

SVG is text, so two more savings apply:

  • Minifying removes line breaks, indentation and unneeded whitespace. The badge went from 746 to 679 bytes. Real-world files exported from design tools often shrink much more, because they carry editor metadata, comments and long decimal coordinates; tools such as SVGO strip those.
  • Web servers compress text on the way to the browser. The minified badge was 417 bytes with gzip and 374 bytes with Brotli. Check that your server sends SVG with compression enabled; PNG and JPG gain nothing from it.

The SVG that's really a PNG

An SVG can embed a bitmap image inside an image tag, encoded as text. Some converters and design exports do exactly that: they wrap the original PNG and call the result an SVG. The badge's 512 px PNG (35.1KB) wrapped this way became a 47.0KB SVG, a third bigger because base64 encoding turns every 3 bytes into 4 characters, and it scales no better than the PNG it contains.

To check a file, open it in a text editor and search for data:image/png;base64 or data:image/jpeg. If most of the file is one long block of letters, it's a bitmap in disguise. Turning a real bitmap into true shapes needs tracing, which works only for simple, flat images; see the guide linked below.

Where SVG opens, and the security caveat

Every current browser displays SVG, and design tools such as Figma, Illustrator and Inkscape edit it. Office software and phone galleries support it less consistently, and many social networks and upload forms refuse it.

The refusal is deliberate. Because SVG is XML, a file can include scripts and links to external resources. Shown as an image in an img tag, scripts don't run, but opened directly as a page they can. Services that accept uploads from strangers often block SVG, or convert it to PNG, for that reason. Only put SVGs from sources you trust directly into your own pages.

When to use SVG and when to avoid it

Use SVG for logos, icons, line art, charts and UI graphics, especially when they appear at several sizes or on high-density screens. A single SVG replaces a set of PNGs at different resolutions.

Avoid it for photos, painted artwork and textures, and for images you must upload to services that block it. When something needs pixels, render the SVG to PNG at the largest size it will be shown.

This site converts SVG to PNG, JPG, WebP and other formats at a width you choose, and traces simple PNG logos into SVG. Both run in your browser without uploading the file.

FAQ

Is SVG better than PNG for a logo?

If the logo was designed as vectors, yes: one small file that stays sharp at any size. If you only have a PNG of the logo, converting it to SVG redraws an approximation; it doesn't recover the original vectors.

What resolution is an SVG?

None. An SVG has a coordinate system and usually a suggested width and height, but no pixel count. You pick the resolution when you convert it to PNG or when a page displays it.

Why does my SVG look different in another program?

Programs differ in font handling, filters and newer CSS features. Text set in a font the other computer doesn't have falls back to another font. Converting text to outlines before export avoids that.

Can an SVG contain a photo?

Only as an embedded bitmap, as described above. That's legitimate when a design mixes a photo with vector shapes, but it doesn't make the photo scalable.

Related

This page was last updated on 2026-11-30

Other format explainers