SVG (Scalable Vector Graphics)
SVG is an XML-based vector image format that stays sharp at any size. Learn when to use SVG for logos and icons, and how to convert it to PNG or JPG.
- Type
- Image
- File extensions
- .svg, .svgz
- MIME type
- image/svg+xml
What is SVG?
SVG describes images as shapes, paths and text in XML rather than as pixels, so it scales to any size without losing sharpness. It is a W3C standard and can be styled with CSS.
Because SVG is code, files from design tools often contain editor metadata that can be removed safely to make them smaller. SVG can also contain scripts, which is why many sites only accept it after sanitizing.
When to use SVG
- Logos and icons
- Illustrations and diagrams with flat colors
- Graphics that must look sharp on every screen density
Limitations
- Not suitable for photographs
- Complex drawings can render slowly
- Many social networks and marketplaces do not accept SVG uploads
Compatibility
Supported by all modern browsers and vector design tools; many photo apps cannot open it.
Compared with other formats
- PNG: Convert SVG to PNG when a platform requires a raster image.
Tools for SVG files
Image Converter
Convert any common image format to JPG, PNG or WebP in a single step.
Image to Base64
Encode an image file as a Base64 string for embedding in JSON, APIs or source code.
SVG to PNG
Rasterize SVG vector graphics to PNG at any size, keeping transparency.
SVG to JPG
Rasterize SVG vector graphics to JPG at any size with a solid background.
Image to Data URI
Turn an image into a data URI with ready-to-paste HTML and CSS snippets.
SVG Optimizer
Shrink SVG files by removing editor metadata, comments and redundant whitespace, and strip scripts.