fileformer
search⌘KtranslateENexpand_moreupload_fileConvert
Converters8 file families · 44 direct conversions
What changes in a conversionarrow_forward

Convert SVG Image Free

An SVG isn't pixels. It's a recipe for drawing.

A JPG or PNG stores the colour of every dot. An SVG stores instructions instead: a circle here, a curve there, this colour. Because it's text, you can read it, edit it, and draw it at any size without it going blurry. Change the code below and the picture follows.

badge.svg · edit me283 bytes
paletteMake it bluecrop_squareSquare cornersline_weightThinner tickrestart_altReset
renderedshown at 192 px wide
error
zoom300%
~/zoom-in-close

Blow both up 8× and the difference is obvious.

The original badge, drawn once as SVG and once as a 64-pixel PNG. At the size it was made, they look identical. Enlarge them and the PNG runs out of dots, while the SVG is recalculated sharp at every size.

SVG · 8× zoomstill sharp
Edges are recalculated for the bigger size, so they stay crisp and the file is still the same few hundred bytes.
PNG 64 × 64 · 8× zoomblocky
Each original pixel becomes an 8 × 8 block. Smoothing would hide the squares but turn them into blur instead.
~/when-to-use-it

Perfect for logos. Hopeless for photos.

An SVG's size depends on how many shapes it has, not how big it's shown. A simple icon is a few hundred bytes; a photo traced into shapes becomes megabytes of code that still looks worse than a JPG.

tokenLogoscheck_circle1-10 KBStays sharp on a business card and a billboard from one file.
interestsIconscheck_circle0.3-2 KBTiny files, and CSS can recolour them for hover or dark mode.
bar_chartCharts and diagramscheck_circle5-50 KBText stays selectable and searchable, and prints perfectly.
mapMaps and floor planscheck_circle50-500 KBZoom in without losing detail, and style each area separately.
drawIllustrationschange_circle20 KB: 2 MBGood for flat artwork; heavy shading and texture make files large.
photo_cameraPhotographscancel5-50 MB tracedEvery shade becomes a shape. Use JPG, WebP or AVIF instead.
screenshot_monitorScreenshotscancelhuge, or a PNG insidePixel content belongs in PNG. An SVG wrapper adds nothing.
mailEmail imagescanceloften blockedGmail and Outlook don’t display SVG. Send a PNG.
~/it-is-code

Because it's code, an SVG can carry more than a picture.

SVG files can contain scripts and links to other files. That's why many sites refuse SVG uploads, and why email apps strip them out. We check for these parts in the SVGs you convert. The code at the top of the page is scanned live.

check_circleScriptsCode that runs when the image is opened directly in a browser.none
check_circleEvent handlersAttributes like onload or onclick that run code.none
check_circleExternal linksReferences to files or pages on other servers.none
check_circleEmbedded HTMLA foreignObject block can hold a whole web page.none
check_circleOversizedVery large files are often traced photos or carry hidden data.none
bug_reportAdd a script to test the scan
~/inspect-an-svg

Open any SVG and see what it draws, what it carries and what it could run.

This page parses the file with your browser’s XML parser and walks every element. It finds scripts, event handlers, external loads and entity tricks, and sorts every byte by purpose. It also checks the size, viewBox and references, then runs a step-by-step optimiser and compares the result pixel by pixel. The file is only ever shown as an image, so nothing in it can run here. Everything happens on your device. .svgz files are decompressed first.

verified-badge.svg · 7.9 KBshown as an <img>: scripts off, no network
Your SVG as rendered by this browser
file size7.9 KBgzip size4.3 KBelements27path data4.4%editor + comments21.9%embedded rasters41.7%
What the file says
EncodingUTF-8 (declared)
Compressionnone (plain .svg)
XMLwell-formed
Root<svg> in the SVG namespace
width × height64mm × 40mm
viewBox0 0 64 40
Default size, CSS px241.9 × 151.2
As <img> in this browser242 × 151 px
Elements27 · nested 6 deep
Active or external itemsnone
DOCTYPE entitiesnone
Embedded rasters1 · 3.3 KB
warningA local file path is stored in the file (C:\Users\adesigner…), which reveals the user name “adesigner” and folder layout. Inkscape keeps export paths; Illustrator and Sketch keep similar data.
infoPhysical units: 64mm × 40mm is 241.9 × 151.2 CSS pixels, at CSS’s fixed 96 px per inch. Print and design tools export this, and on screen it sets the default size.
info17 of 20 ids are never referenced. Editors give every element one. Unused ids cost bytes, and they can clash when several SVGs are inlined into one page.
infoCoordinates carry up to 6 decimals. At the default size one unit is 3.78 CSS px, so the last digit is worth 3.8e-6 px, invisible even at 10× zoom. The optimiser below rounds them.
warning1 text element uses “Avenir Next”, which is not embedded. A viewer without that font substitutes another, so widths, line breaks and the look change; as an <img>, outside fonts cannot load at all. Convert the text to outlines, or embed the font as WOFF2 in @font-face, before sharing.
warning1 embedded raster image (image/png), 41.7% of the file. Base64 makes them a third larger than the image file itself, and they stay pixels: enlarge the SVG and they blur. This is mostly a raster image in an SVG wrapper; as PNG, JPG or WebP it would be smaller.
info1.6 KB (20.6%) is editor data: window size, zoom, layer names, creator metadata. Viewers ignore it.
Every byte by purpose, to scaleall 7.9 KB
Prolog, DOCTYPE, PIs0.7% · 54 BComments0.7% · 57 BEmbedded rasters41.7% · 3.3 KBEditor data and metadata20.6% · 1.6 KBStyling8.0% · 642 BPath and point data4.4% · 357 BWhitespace1.4% · 116 BOther markup22.5% · 1.8 KB
Active and external content
WhatWhereCodeAs <img> or CSSInline, <object> or opened directly
Browsers treat an SVG loaded through <img>, CSS background-image or <picture> as a static picture: no scripts, no links, no network fetches. The same file inlined into HTML, embedded with <object> or <iframe>, or opened from its own URL on your domain is a full document, and its scripts run with that origin’s cookies. This is why upload forms should either refuse SVG or serve it from a separate domain with Content-Security-Policy: script-src 'none'.
Elements27 elements, 22 kinds
linearGradient2stop2filter2feGaussianBlur2path2svg1sodipodi:namedview1defs1metadata1rdf:RDF1cc:Work1dc:format1dc:type1dc:creator1cc:Agent1dc:title1g1rect1image1circle1text1tspan1
Paint, clips, filters, stylesShapesStructureEditor dataRasterText
Paths, references and text
Path and polygon elements2 · 347 B of data
Commands6 · 3 absolute, 3 relative
By commandM 2 · L 2 · C 1 · Z 1
Numbers38 · up to 6 decimals
ids20 defined · 3 referenced · 17 unused
Broken referencesnone
Text elements1
Fonts namedAvenir Next
Optimise, one step at a timeEach step edits the parsed document and re-serialises it, so the bars show what that step alone saves. Removing active content is always on. Unused ids are only safe to drop when no outside CSS or script targets them.
decimals2 dp
Original fileas opened, uncompressed7.9 KBbaseline
Comments and prolog1 comments and PIs, plus DOCTYPE and XML declaration7.1 KB−9.5%
Editor data31 elements and attributes5.6 KB−19.8%
Active content0 scripts, handlers, javascript: links5.6 KBsame
Unused ids and defs16 ids and dead definitions5.3 KB−3.3%
Round numbers25 attributes, to 2 decimals5.0 KB−3.8%
Shorter path syntax2 d and points attributes5.0 KB−0.2%
Whitespace22 whitespace-only text nodes4.9 KB−1.2%
Rounding to 2 decimals moves a point by at most 0.005 units, 0.019 CSS px at the default 242 px width. Transforms keep 5 decimals, because a scale factor multiplies every error. The comparison on the right renders both files at 480 px and counts pixels that differ by more than 16 of 255 levels.
Before and after480 × 300 px
originaloptimiseddifference, ×8
Original7.9 KB · gzip 4.3 KB
Optimised4.9 KB · gzip 3.4 KB
Saved37.9% raw · 21.7% gzipped
Active content removednone found
Pixels59 differ (<0.1%) · worst 93 levels
downloadDownload optimised SVG
~/choosing-a-size

A drawing has no resolution until you pick one.

Every other image format on this site arrives with its dimensions already decided. A JPG is 4000 pixels wide because a sensor made it that way, and enlarging it invents detail that was never captured. An SVG has no pixels at all until something draws it, so the width and height you choose at conversion time are not a resizing step, they are the first time the image has had a size.

That is why the number you type matters more here than on any other converter. The sample file on this page declares viewBox="0 0 64 64" with a width and height of 64, but those attributes are a default, not a limit: the same file rendered at 1024 pixels is not upscaled, it is redrawn, and every curve is recalculated at the larger size. Ask for 64 pixels and you get a crisp small icon. Ask for 1024 and you get a crisp large one. Nothing in between is interpolated.

The decision that follows is which pixel format to land in, and it is mostly about transparency and edges. PNG and WebP keep the alpha channel, so a logo stays cut out against whatever sits behind it. JPG has no transparency at all and will fill those areas, usually with black or white, and its compression softens exactly the hard edges a vector drawing is made of. For a logo or an icon, PNG or WebP; for a photographic illustration that happens to be stored as SVG, JPG is defensible.

Two more things are lost in the move to pixels, and both are worth knowing before you convert rather than after. Styling goes: an SVG whose shapes use currentColor picks up the surrounding text colour and can be recoloured by CSS for hover states or dark mode, and a PNG of that same drawing is one fixed colour forever. Scripted or animated parts go too, which is usually a relief, because the inspector above exists to find exactly those scripts, event handlers and external loads before they reach a browser.

If the file is going to stay on the web and the target supports it, the best conversion is often no conversion: optimise the SVG and ship it. The optimiser on this page runs step by step and compares its output with the original pixel by pixel, so you can see that nothing shifted before you accept the smaller file. Rasterise when the destination cannot read SVG, which in practice means email clients, older document formats, and any upload form that rejects the extension outright.

~/why-uploads-refuse-svg

An SVG is a document, which is why upload forms turn it away.

Every other image format on this page is inert data. A PNG is a grid of compressed pixels and a decoder; it cannot do anything. An SVG is markup, and markup can carry scripts, event handlers and references to other files. That single difference is why so many sites refuse SVG uploads outright and why email clients strip them, and it has nothing to do with the drawing itself.

The risk depends entirely on how the file is served. Placed in an ordinary image tag, a browser will not run scripts inside it. Embedded in an iframe, or opened directly from its own URL on your domain, that same file is a full document, and anything scripted in it runs with your origin's cookies. A form that accepts user-supplied SVG and serves it back from the main domain has handed visitors a way to run code as that site.

This is why the safe pattern is either to refuse SVG on upload or to serve it from a separate domain that holds no session, and why so many products choose the first option as the cheaper answer. If a form has rejected your logo and you were sure the file was fine, this is usually the reason: the rejection is about what the format can contain, not about what your particular file does contain.

The inspector above exists to tell those two cases apart. It parses the file with the browser's own XML parser, walks every element, and reports scripts, event handlers, external loads and entity tricks, sorting every byte by what it is for. A clean logo shows nothing but geometry and style, and you can say so with evidence rather than hoping.

When a destination will not take SVG and you cannot change that, rasterising is the fix, and it removes the question completely: a PNG or WebP of the same drawing cannot carry a script because the format has nowhere to put one. Convert at the size you need, keep the SVG as the editable master, and send the pixels where the markup is unwelcome.

~/spec-sheet

SVG at a glance: the technical reference.

How to identify, serve and validate an SVG file, drawn from the W3C specification.

Full nameScalable Vector Graphicsan XML language for 2D drawings
Extensions.svg · .svgz.svgz is the same file gzip-compressed
MIME typeimage/svg+xmlserve with this, or browsers show the code
Starts with<svg xmlns="…/2000/svg"often after an <?xml ?> line; no binary magic
StandardW3C SVG 1.1 (2011) · SVG 2SVG 2 is a Candidate Recommendation
Coordinate spaceviewBox + width/heightviewBox sets the drawing units; size is separate
Size limitnonedrawn fresh at any size, so it never pixelates
ColoursRGB, any CSS colourgradients, patterns and filters built in
Compressionnone (text) · gzip (.svgz)servers usually gzip SVG on the fly
Transparencyfull, per shapeopacity and fill-opacity on anything
AnimationCSS, SMIL, JavaScriptSMIL animate tags work in all current browsers
Securitycan contain scriptssanitise uploads; see the scan above
~/the-d-attribute

Every shape is a path, and a path is ten letters.

Inside the d attribute, each letter is a pen instruction followed by numbers. Capitals use absolute coordinates; lowercase ones move relative to the current point. Pick a command to see it drawn.

Mmove toLline toHhorizontalVverticalCcubicSsmoothQquadraticTsmooth quadAarcZclose
viewBox 0 0 100 100 · origin top-left · y grows downward
Cubic BézierC x1 y1 x2 y2 x yA smooth curve pulled towards two control points. Most curves from design tools are cubics.
<path d="M 15 75 C 30 10, 70 10, 85 75"/>
x1 y130 10first control pointx2 y270 10second control pointx y85 75end point
black dot: pen before this command · pink: what this command draws
~/twenty-five-years

From a W3C draft to every browser: the SVG timeline.

SVG was standardised early but took a decade to be usable everywhere, because Internet Explorer didn’t support it until version 9.

1998Proposals mergeW3C combines rival vector formats (VML, PGML) into one effort.
2001SVG 1.0Becomes a W3C Recommendation; needs a plug-in to view.
2003SVG TinyA cut-down profile for early mobile phones.
2011IE9 and SVG 1.1 2nd ed.Every major browser can now show SVG natively.
2018+SVG 2Aligns SVG with modern CSS and HTML; still being finalised.