SVG MIME Type

Learn what image/svg+xml identifies, how SVG files work, which applications open them, and how Poly previews and indexes them.

MIME type details for image/svg+xml

In active use
MIME typeimage/svg+xml
Extensions
.svg.svgz
Alternate versions
image/svg
First standardized2001
Created byWorld Wide Web Consortium SVG Working Group
Browser supportChrome, Edge, Firefox, Opera, Safari
Example applicationsInkscape, Adobe Illustrator
Poly supportYes. Poly recognizes `image/svg+xml`, the `image/svg` alias, and `.svg` filenames, then renders the static SVG with resvg. It does not infer `.svgz`.
Indexed by PolyYes. Poly indexes the filename, available dimensions, and a visual embedding of the static rendering. It does not index SVG markup or visible text as text.
Preview in PolyYes. `.svg` files open in Poly's image viewer using the browser's image rendering. Interactive document behavior is not provided, and `.svgz` is not inferred from its filename.
Poly agentPartial. The Poly agent receives a static WebP rendering and can reason about its appearance, but it cannot inspect the XML, follow links, run scripts, or observe animation.

What does image/svg+xml mean?

The image/svg+xml media type identifies Scalable Vector Graphics, an XML language for describing two-dimensional graphics. Instead of storing a fixed grid of pixels, an SVG can describe paths, shapes, text, gradients, filters, embedded raster images, and reusable components. This makes SVG particularly useful for icons, diagrams, maps, charts, and logos that need to stay sharp at different sizes.12

The +xml suffix matters. It tells software that the representation follows XML rules as well as SVG's own vocabulary. The current registration has no required parameters and permits the same optional charset parameter as application/xml.1

IANA lists image/svg+xml in the standards tree and points to W3C's registration. The registered extension is .svg. The registration also documents .svgz as a conventional name for gzip-compressed SVG, effectively an .svg.gz stream rather than a different graphics language.13

image/svg is an unregistered alias found in older software. Use image/svg+xml in HTTP Content-Type headers, HTML source declarations, and new application data. Poly accepts both identifiers, but serializes the canonical one.

How can you identify an SVG file?

SVG has no fixed magic number. An uncompressed file may begin with a UTF byte-order mark, whitespace, a comment, or an XML declaration, so checking only the first few bytes is unreliable. A stronger check parses the content as XML and finds an svg root element in the SVG namespace:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
  <circle cx="50" cy="50" r="40" fill="tomato" />
</svg>

The viewBox establishes the drawing's coordinate system. Explicit width and height attributes can provide a preferred displayed size, but a valid view box lets a renderer scale the artwork without changing its geometry.

For .svgz, first confirm the gzip wrapper, decompress it with normal gzip tooling, and then apply the XML and namespace checks. A gzip signature by itself does not prove that the payload is SVG.

Renaming a PNG, JPEG, or PDF to .svg does not turn it into vector artwork. Likewise, wrapping an SVG in gzip without serving the correct content encoding can cause viewers to reject it.4

Where SVG came from

W3C published SVG 1.0 as a Recommendation on September 4, 2001. It defined a language for two-dimensional vector and mixed vector/raster graphics in XML. The work brought together browser, graphics, publishing, and hardware companies through the W3C SVG Working Group.56

SVG 1.1 followed in 2003 and was republished as a second edition in 2011.7 SVG 2 continues the language's development and supplies the current media-type registration referenced by IANA. The W3C SVG Working Group remains responsible for developing and maintaining the standard.18

SVG's text foundation is a practical difference from binary image formats. A simple drawing can be authored or inspected in a text editor, generated from data, styled with CSS, and manipulated through the document object model. That flexibility also means that SVG is closer to a web document than a passive bitmap when it is embedded as a document rather than used as an image.

How to open an .svg file

Chrome, Edge, Firefox, Opera, and Safari all display SVG. A browser is usually the quickest viewer, especially for a file intended for the web.2

Use a graphics editor when you need to change paths, text, gradients, or layout:

  • Inkscape uses SVG as its central vector format and can save editor-specific or plain SVG.9
  • Adobe Illustrator can save and export SVG, although some Illustrator features may be rasterized or represented differently in the exported result.10
  • A source-code editor is useful for small fixes, generated graphics, accessibility metadata, and diagnosing references or CSS.

An SVG used through an HTML <img> or CSS behaves as an image. Browsers generally disable scripts and external resource loading in that context. Opening SVG as a standalone document or embedding it with <object>, <embed>, or <iframe> gives it a more document-like execution environment, so the two uses have different security and interaction behavior.11

Support in Poly

Poly recognizes the canonical image/svg+xml type, the image/svg alias, and .svg filenames. It routes SVG through its image pipeline and uses the resvg library to produce a static raster rendering. Repository integration tests verify that a normal SVG receives WebP thumbnails and both file-level and page-style visual embeddings.

That processing enables:

  • Thumbnail generation and the image viewer.
  • Width and height metadata when the dimensions can be determined.
  • Search by filename and visual similarity.
  • Visual reasoning by the Poly agent from a rendered WebP image.

There are important boundaries. Poly treats SVG as an image, not as searchable source text. Text elements in the XML are not indexed as words, and the rasterized result is not OCR'd. The indexer uses resvg's static SVG subset, which intentionally excludes scripts, events, links, and animation.12 Fonts available to the renderer can also differ from the fonts on the machine that created the file, and linked resources may not reproduce like embedded resources.

Poly's interactive image viewer loads ordinary .svg bytes through the browser's image path. The agent and visual search do not receive that live document. They use static WebP derivatives, so animation, interaction, XML structure, metadata, element IDs, and off-screen states are not available to them.

Poly does not map .svgz filenames to SVG automatically. If a compressed file is classified only by its name, it can miss the SVG image pipeline. Decompress it to .svg before uploading when you need dependable thumbnails, preview, visual indexing, or agent access.

Do not assume that visible words in an SVG are text-searchable in Poly. Search uses the filename and visual embedding, while the agent sees a rendering. Keep important prose in an accompanying text document or descriptive filename when it needs to be found verbatim.

SVG compared with raster images

SVG is not automatically smaller or better than every bitmap. The right choice depends on what the picture contains.

PropertySVGPNGJPEG
RepresentationXML drawing instructions, with optional embedded raster dataLossless pixel gridUsually lossy pixel grid
ScalingShapes and text can stay sharp at any output sizeEnlarging reveals pixelsEnlarging reveals pixels and compression artifacts
Best fitIcons, logos, diagrams, charts, mapsScreenshots, sharp raster graphics, transparencyPhotographs and continuous-tone images
InteractionPossible in document contextsNone in the file formatNone in the file format
Editing modelObjects, paths, styles, and source markupPixel editingPixel editing

A complicated SVG can be larger and slower to render than a well-compressed raster image. Photographs stored inside an SVG remain raster images, so wrapping them in XML does not create resolution-independent detail. Conversely, converting an icon to JPEG discards the paths and can introduce halos around sharp edges.

Converting SVG to PNG or PDF

Choose the destination based on how the result will be used:

  • Export to PNG for a fixed-size, lossless raster image with transparency. Pick the pixel dimensions before export because the vector information is discarded.
  • Export to PDF for printing or document workflows that can preserve supported vector objects. Review fonts, filters, clipping, and page bounds after conversion.
  • Keep SVG for responsive web graphics and future vector editing.

Inkscape's PNG export lets you select the page, drawing, selection, or a custom area and set the output pixel dimensions. Its documentation recommends retaining the SVG master because other formats do not support every Inkscape or SVG feature.1314

Before converting, embed any images or fonts that must travel with the artwork, or convert critical decorative text to paths when licensing and accessibility needs allow it. After converting, compare the output at the actual delivery size. Filters, blend modes, font substitution, and external resources are common sources of differences.

Is .svgz the same format as .svg?

The SVG content model is the same, but the bytes are not. An .svg file is XML. An .svgz file is that SVG content compressed with gzip. Software must decompress it before parsing the XML, and web servers need to distinguish the SVG media type from the gzip content encoding correctly.14

Compression can also be applied during HTTP transfer without changing the filename to .svgz. For web delivery, that is often easier to configure and debug because the resource remains image/svg+xml while the transport reports gzip or another supported content encoding.

Security and privacy considerations

Treat SVG from an unknown source as active content, even when your immediate use is a static image. The media-type registration warns that SVG can reference arbitrary URIs and external media, include scripting languages, and inherit XML risks such as excessive entity expansion.1

Safer handling depends on context:

  • Use a maintained parser and renderer with resource and memory limits.
  • Serve untrusted SVG as an image when interaction is unnecessary, and apply a restrictive Content Security Policy when it is embedded as a document.
  • Remove scripts, event attributes, external references, and unexpected foreignObject content before publishing user-supplied files.
  • Embed required raster assets rather than relying on local paths or private URLs.
  • Inspect metadata, comments, links, and text before sharing a design outside its original environment.

Browser image restrictions reduce exposure, but they do not make arbitrary XML safe for every downstream editor, converter, or document embedding context.11

Footnotes

  1. World Wide Web Consortium. Media Type Registration for image/svg+xml. Defines the parameters, .svg extension, .svgz convention, security considerations, and change control for the registered type. 2 3 4 5 6
  2. MDN Web Docs. Image File Type and Format Guide: SVG. Describes SVG's web uses, .svg extension, and browser support. 2
  3. Internet Assigned Numbers Authority. Media Types Registry. Lists image/svg+xml and W3C as its registration authority.
  4. World Wide Web Consortium. SVG 1.1 Conformance Criteria. Describes handling requirements for compressed SVG and its HTTP encoding headers. 2
  5. World Wide Web Consortium. Scalable Vector Graphics (SVG) 1.0 Specification. W3C Recommendation dated September 4, 2001.
  6. World Wide Web Consortium. SVG 1.0 Recommendation Press Release. Describes the working group's cross-industry development and the Recommendation's goals.
  7. World Wide Web Consortium. Scalable Vector Graphics (SVG) 1.1, Second Edition. Records the January 2003 first edition and August 2011 second edition.
  8. World Wide Web Consortium. SVG Working Group. States the group's mission to develop and maintain SVG.
  9. Inkscape. About SVG. Explains SVG's role as Inkscape's central vector format.
  10. Adobe. How to Save Artwork in Illustrator. Documents SVG save and export behavior and format limitations.
  11. MDN Web Docs. SVG as an Image. Describes image contexts and their script and external-resource restrictions. 2
  12. Linebender. resvg. Documents the renderer's static SVG subset and exclusions for scripts, events, links, and animation.
  13. Inkscape. Exporting a PNG File. Documents export areas, dimensions, and transparency.
  14. Inkscape. Exporting to Other File Formats. Recommends preserving the SVG master because export formats may lose features.
© Poly Corp. 2026