SVGZ (Compressed SVG)
The same crisp vector graphics as SVG, squeezed down by gzip so pages load faster.
| Full name | Compressed SVG |
| Extension | .svgz |
| MIME type | image/svg+xml |
| Developer | World Wide Web Consortium (W3C) |
| Released | 2001 |
| Type | Compressed vector image |
| Compression | gzip (deflate) |
| Based on | SVG 1.0 / XML |
What is a SVGZ file?
SVGZ is a gzip-compressed version of the SVG vector image format. It stores exactly the same XML data as a plain SVG file, but in a binary compressed envelope that is typically 20 to 50 percent smaller. Browsers and servers that understand SVG also understand SVGZ, making it a drop-in size reduction with no loss of quality.
An SVGZ file is a standard SVG XML document that has been run through gzip compression before saving. Because SVG is a text-based format full of repetitive XML tags and coordinates, gzip compresses it very efficiently. The resulting file is a binary gzip stream; the graphics inside remain fully scalable and editable once decompressed. Both .svg and .svgz use the same MIME type, image/svg+xml, with the server adding a Content-Encoding: gzip header to signal the compression.
History
The W3C published SVG 1.0 as a formal Recommendation on September 4, 2001, and the gzip-compressed variant was included from the start as an official part of that specification. The W3C recommended the .svgz extension specifically so that content authors who lacked control over their server configuration could still serve compressed SVG files. Apache server support for the Content-Encoding approach was documented early in the format's life, and SVG 1.1 (2003, second edition 2011) carried the same convention forward unchanged.
How it works
A .svgz file begins with the two-byte gzip magic number 0x1F 0x8B, followed by standard gzip headers and then the deflate-compressed SVG XML payload. There is no SVGZ-specific wrapper; the format is simply raw gzip applied to an SVG document. When a browser or renderer receives the file, it decompresses the gzip stream in memory and parses the resulting XML exactly as it would a plain .svg file. Because the internal format is identical to SVG after decompression, all SVG features such as paths, gradients, animations, and embedded scripts work normally.
What it is used for
- Serving icon sets and logos on websites where bandwidth or load time matters
- Distributing vector maps or diagrams as downloads at a smaller file size
- Embedding detailed technical illustrations in documentation portals
- Packaging scalable assets in web apps where the server can set Content-Encoding headers
How to open it
Most modern browsers, including Chrome, Firefox, Safari, and Edge, open SVGZ files directly as long as the server sends the correct Content-Encoding: gzip header. Design tools such as Inkscape, Adobe Illustrator, and Affinity Designer can also open and export SVGZ files natively.
Pros and cons
Strengths
- Typically 20 to 50 percent smaller than an equivalent plain SVG file
- No quality loss; the vector data is identical after decompression
- Supported natively by all major browsers without a plugin
- Uses the same MIME type as SVG, so most server and CDN rules apply without changes
Trade-offs
- Requires correct server configuration (Content-Encoding header) or browsers may display garbled output
- Cannot be opened or edited as plain text without first decompressing it
- Some older tools and CMS platforms do not recognise the .svgz extension
- Double-encoding can occur if a server also applies automatic gzip compression to SVG files
Convert SVGZ files
Free, in your browser, no signup. Start at the SVGZ converter, or jump straight to a popular conversion below.
Curious how fast and how small? See our measured conversion benchmarks.
SVGZ FAQ
Is SVGZ lossless?
Yes. gzip compression is completely lossless, so decompressing an SVGZ file gives back the original SVG XML byte for byte.
Do I need a special server setting to serve SVGZ?
Yes. The server must send the Content-Encoding: gzip response header alongside the image/svg+xml Content-Type, otherwise most browsers will display a broken image or raw binary text.
Can I edit an SVGZ file directly?
Not without decompressing it first. You can open it in tools like Inkscape or Illustrator, which handle decompression transparently, then save it back as SVGZ or plain SVG.
What is the difference between serving SVG with gzip and serving an SVGZ file?
They produce the same bytes on the wire. The difference is where compression happens: a web server can compress a plain .svg on the fly, while .svgz is pre-compressed on disk. Pre-compressed files save server CPU but need the Content-Encoding header set manually.