What Is a .SVG File? (.svg, .svgz)
A .svg file is a Scalable Vector Graphics image: a text file written in XML that describes shapes, paths and text rather than pixels. SVGs stay perfectly sharp at any size, are usually tiny, and display in every web browser, which makes them the standard format for logos, icons and web illustrations.
- Extension
- .svg, .svgz
- Full name
- Scalable Vector Graphics
- Type
- Image file
- MIME type
- image/svg+xml
- Developed by
- World Wide Web Consortium (W3C)
About SVG files
Instead of storing pixels, an SVG lists drawing instructions, for example a circle at these coordinates with this fill color. Open one in a text editor such as Notepad or VS Code and you can read and edit it directly. Because shapes are redrawn at whatever size is needed, an SVG logo looks crisp on a phone, a 4K monitor or a billboard, and a simple icon is often under a few kilobytes.
SVG suits flat graphics: logos, icons, charts, maps, diagrams and line art. It is a poor fit for photographs; an SVG can embed a bitmap, but then it is not truly scalable. SVG supports transparency, gradients, text, CSS styling and animation. A .svgz file is the same thing compressed with gzip.
Because SVG is a document format, it can contain JavaScript and links. A script in an SVG opened directly in a browser can run like a web page, and SVG attachments have been used in phishing emails to redirect people to fake login pages. Treat unexpected SVG attachments with the same caution as HTML files, and websites that accept SVG uploads should sanitize them.
Desktop support for viewing is the main gotcha. Browsers open SVG perfectly, but macOS Preview does not open SVG files (Quick Look can preview them), and Windows 11 File Explorer does not show SVG thumbnails unless you add Microsoft PowerToys, whose File Explorer add-ons include an SVG previewer. Recent versions of Microsoft Office can insert SVG icons into documents.
What SVG files are used for
- Website logos, icons and illustrations
- Icon sets and UI assets for apps and design systems
- Charts, diagrams and maps exported from data tools
- Files for cutting machines, laser cutters and plotters
- Print graphics that must scale to any size
How to open a .svg file
Windows
Open it in Edge or Chrome to view it. To edit, use Inkscape (free) or a text editor like Notepad or VS Code for the code.
Mac
Select it in Finder and press Space for Quick Look, or open it in Safari or Chrome. Preview does not open SVG; use Inkscape to edit.
iPhone and iPad
The Files app previews SVG files; Safari also displays them.
Android
Open it in Chrome; most gallery apps do not show SVG files.
Online / any browser
Every modern browser renders SVG; drag the file into a browser window.
How to convert a .svg file
To get a PNG, open the SVG in Inkscape and use File > Export with the size you want; because it is vector, you can export at any resolution without blurring.
Without extra software, open the SVG in a browser and take a screenshot, or on a Mac run "sips -s format png file.svg --out file.png" in Terminal.
Converting PNG or JPG to SVG is different: it requires tracing the image into shapes (Inkscape's Path > Trace Bitmap does this). Renaming a .png to .svg does not make it a vector.
Convert it here, free and without uploading: SVG to PNG, SVG to JPG, SVG to PDF
Changing the extension in the file name does not convert the file. See how to change a file extension for when renaming is safe.
Naming and renaming SVG files
- For icon sets, use lowercase, hyphenated names with a consistent prefix, such as icon-arrow-left.svg, because developers often reference SVG files by name in code.
- Avoid spaces and special characters in SVG file names you will use on the web; they need URL encoding and break some build tools.
- If you keep a source file and an optimized web copy, suffix them clearly (logo.svg and logo.min.svg).
Renaming lots of .svg files? See how to rename svg files with ai, use the free online bulk renamer for patterns and numbering, or try File Renamer AI to name each file from what is inside it.
Related file types
A .png file is a Portable Network Graphics image, a lossless format that keeps every pixel exactly as saved and supports full transparency. PNG is the standard for screenshots, logos, icons and web graphics with sharp edges or text, though photos saved as PNG are much larger than JPGs.
A .ai file is an Adobe Illustrator artwork file, the native format for vector graphics created in Illustrator. It stores shapes, paths, text and artboards that scale to any size without losing quality, which is why logos and print designs are often delivered as AI files. Fully editing one requires Illustrator or a compatible vector editor.
A .eps file is an Encapsulated PostScript graphic, an older vector format used to exchange logos and illustrations between design and print software. An EPS contains PostScript drawing instructions and often a low-resolution preview image. It is still requested by some printers and stock image sites, but modern systems support it less and less.
A .pdf file is a Portable Document Format document: a fixed-layout file that looks the same on every device, with its text, fonts, images and page geometry packed inside. It is the standard format for sharing finished documents such as invoices, contracts, forms, manuals and scanned paperwork that should not reflow.
Frequently Asked Questions
What is an SVG file used for?
Mostly logos, icons, illustrations and diagrams on websites and in apps, because SVGs stay sharp at any size and are very small.
Is an SVG file safe to open?
SVGs can contain scripts and links, and they have been used in phishing emails. Opening an SVG you created or downloaded from a trusted site is fine; be wary of unexpected SVG email attachments.
Can I convert a JPG to SVG?
Not by renaming it. A photo must be traced into shapes with a tool like Inkscape's Trace Bitmap, which works well for simple logos and poorly for detailed photos.
Why won't Preview open my SVG on a Mac?
Preview does not support SVG. Use Quick Look (press Space in Finder), a browser, or Inkscape.
What is an .svgz file?
An .svgz file is an SVG compressed with gzip. Browsers and Inkscape open it directly.