.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.

How to open 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. For a step-by-step walkthrough, see how to open a .svg file.

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

How to convert a .svg file

You can convert a .svg file to PNG, PDF, WebP using a conversion tool or the export menu of an app that opens it.

.svg file signature (magic bytes)

Programs recognise a .svg file by the bytes at the start of the file, not by its name. These are the signatures for SVG. For a full breakdown, see the SVG file signature page.

Hex signatureOffsetNote
3C 3F 78 6D 6C0<?xml (usually)
3C 73 76 670<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: