What is the SVG file format?
The .svg abbreviation stands for Scalable Vector Graphics, and it is a format for 2D graphic files. SVG is an XML-based language designed to describe 2D graphics in plain text. The .svg format was developed by the *World Wide Web Consortium (W3C)* and is the standard format for displaying vector graphics on the web, becoming a W3C Recommendation in 2001 (SVG 1.1 followed in 2011).
Because text is used to describe vector graphics, the scale of an .svg file can be changed without any quality loss. To put it simply - the content of the file, an image, can be displayed at any size without pixelation, making .svg ideal for icons, logos, illustrations, and UI elements that must look sharp at any resolution.
.svg files can also be compressed using GZIP compression, after which the format changes to .svgz, with the final size reduced by roughly 50-80%.
Due to their textual, XML-based nature, .svg files can be searched, indexed, compressed, and scripted, which makes them perfectly suited for sharing graphics on the web. All modern browsers natively render .svg images without any plugin. .svg files are equally supported by plain text editors and advanced vector editors such as Inkscape or Adobe Illustrator, and they can embed PNG raster images, animations, CSS styling, and interactive JavaScript directly within the file. The MIME type is image/svg+xml.
Security & safety
RISK: MEDIUMSVG is XML and can EMBED CSS and JavaScript, so an .svg opened in a browser can run scripts - this makes malicious SVGs a real cross-site-scripting, redirect and phishing vector, and SVG e-mail attachments have been used in malware campaigns (a "harmless picture" that actually contains a script or HTML form). Treat unsolicited .svg files like web pages, not images: don't open them from unknown senders, and on websites sanitize uploaded SVGs (strip scripts/event handlers) before serving them. Opening an SVG in a non-scripting viewer or a code editor to inspect the XML is safe. Avoid sketchy "free SVG opener/converter" download sites that bundle adware - the browser and Inkscape cover the real needs.
Format details
in a nutshellPrograms that open SVG files
Technical details
deep spec| File structure | Plain XML text; human-readable and editable in any text editor without special software |
| MIME type | image/svg+xml |
| Character encoding | UTF-8 (declared in the XML header); the file is plain Unicode text with no binary content |
| Scalability | Infinite lossless scaling - geometry is defined mathematically, so no pixelation occurs at any size |
| Compressed variant | .svgz - the same SVG XML wrapped in gzip; file size typically 50-80% smaller |
| Animation support | Declarative SMIL animations and CSS animations/transitions are both supported |
| Scripting | JavaScript can query and modify SVG elements through the standard DOM API, enabling interactivity |
| Styling | CSS can be applied via inline style attributes, embedded <style> blocks, or external stylesheets |
| Coordinate system | Infinite canvas with user-defined units; the viewBox attribute maps document coordinates to the viewport |
| Shape primitives | path, circle, rect, ellipse, polygon, polyline, line - plus gradients, patterns, masks, and filter effects |
| Browser rendering | Native support in all modern browsers (Chrome, Firefox, Edge, Safari) - no plugin required |
| Embedding in HTML | Can be used inline as <svg>, referenced via <img>, <object>, <embed>, or as a CSS background-image |
| Accessibility | Text nodes are machine-readable; supports <title> and <desc> elements plus ARIA attributes |
| Raster embedding | External raster images (PNG, JPEG) can be embedded via <image> elements using file paths or data URIs |
| File identification | No binary magic bytes; identified by the <svg root element, optionally preceded by an XML declaration or DOCTYPE |
| Released | 2001 (SVG 1.0 W3C Recommendation); SVG 1.1 (2011); SVG 2 in development |
| Open standard | Yes · royalty-free |
| Specification | www.w3.org |
SVG conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about SVG files.