.svg

What is a .svg file?

Scalable Vector Graphics · Image · W3C · 2001

SVG stores images as math, not pixels, so they stay razor sharp at any size. It is the standard for logos, icons and illustrations on the web, and because it is really XML text, you can open and edit it in any code editor.

Category
Image
MIME type
Type
Plain text
Is a .svg file safe to open? Mostly safe, with one caveat: an SVG can contain scripts. Open unknown SVGs in a viewer, not by embedding them directly, if you are unsure of the source.

What is a .svg file used for?

An SVG describes shapes, paths, text and gradients as instructions the browser draws on the fly. Scale it to a billboard and it stays crisp, which is why it dominates logos and UI icons.

Being XML text, an SVG is human readable and tiny for simple graphics. It can also carry CSS and, in some contexts, scripts, so treat SVGs from untrusted sources with a little care.

SVG is not meant for photographs. Anything with fine, unpredictable detail is better as a raster format like PNG or WebP.

What opens a .svg file?

The .svg format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.

Windows

  • Any browser
  • Inkscape
  • Illustrator
  • text editor

macOS

  • Any browser
  • Inkscape
  • Illustrator
  • text editor

Linux

  • Any browser
  • Inkscape
  • text editor

Web

  • Every browser renders SVG

Open a .svg file step by step

  1. Confirm the file really is a .svg. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
  2. On Windows, open it with Any browser or Inkscape.
  3. On Mac, use Any browser or Inkscape.
  4. On Linux, try Any browser or Inkscape.
  5. Still stuck? Convert the .svg to PNG, which opens more widely.

Why can't I open my .svg file?

Almost always because no installed app understands SVG. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.

The other possibility is that the file is not really a .svg at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.

How to convert a .svg file

You can convert a .svg file to PNG, PDF, WebP.

Inkscape rasterises an SVG to PNG at any resolution through File then Export, which is the point: an SVG has no fixed pixel size until you pick one. Once rasterised it stops being scalable, so keep the original.

What is the .svg file signature (magic bytes)?

A .svg file may start with the hex bytes 3C 3F 78 6D 6C, which read as <?xml in ASCII. Those bytes are a hint rather than a guarantee, so SVG cannot be identified by its header alone.

These are the documented signatures for SVG. For a full breakdown, see the SVG file signature page.

Documented magic-byte signatures for the .svg format
Hex signatureOffsetASCIINote
3C 3F 78 6D 6C0<?xml<?xml (usually)
3C 73 76 670<svg<svg (no XML prolog)

See the full magic-numbers reference for every format.

Frequently asked questions

What is a .svg file?

SVG stores images as math, not pixels, so they stay razor sharp at any size. It is the standard for logos, icons and illustrations on the web, and because it is really XML text, you can open and edit it in any code editor.

Can I edit an SVG in a text editor?

Yes. SVG is XML, so any code editor opens it. For visual editing, use Inkscape or Illustrator.

Why won't my SVG show up in Word?

Older Office versions have limited SVG support. Convert it to PNG for reliable display in documents.

Related formats

Sources

Details on this page were checked against authoritative references. How sources are ranked and what is deliberately left out is set out in the methodology.