SVG optimizer and converter
Strip comments, metadata and drawing-app leftovers out of an SVG, round its numbers and see how many bytes you saved. Then take it out as a React, Vue, React Native, Flutter or Android component, a data URI, CSS or a PNG. Nothing is uploaded.
Sign in to save this toolPaste the markup or open an .svg file (up to 5 MB). It is parsed in a detached document and never placed in this page.
Used for the generated component and file name: Icon.
Fewer places, smaller file. Two is safe for icons.
More cleanup options
Preview
Scripts, event handlers (on…), <foreignObject> and javascript: links are always removed from every output. The preview is shown as an image, so nothing in the file can run.
Preparing…
Export as PNG
Height follows the drawing’s proportions. 16 to 4096 pixels.
How to use it
- Paste SVG markup into the box, or open an .svg file from your device.
- Choose how many decimal places to keep and any extra cleanup, such as removing unused ids or the fixed width and height.
- Check the preview against a transparent, light or dark background, and compare the original and optimised sizes.
- Pick an output format, such as optimised SVG, React, Vue, Flutter, Android XML, data URI or CSS, then copy or download it.
- To get a bitmap, enter a width and download the drawing as a PNG.
Supported formats and limits
- Input up to 5 MB of SVG markup. Files that declare XML entities (<!ENTITY>) are refused.
- Scripts, event handler attributes (onload, onclick…), <foreignObject>, link-rewriting animations and javascript: links are always removed from every output.
- The optimiser does not merge paths, flatten transforms or remove ids that something references, because those can change how the drawing looks.
- PNG export: 16 to 4096 pixels wide; the height follows the drawing’s proportions. External images referenced by the SVG are not loaded.
- Android VectorDrawable cannot hold text, images, masks, filters or gradients without extra markup. These are skipped and listed as warnings.
Examples
- An icon exported from Inkscape or Illustrator with comments, metadata and editor attributes usually shrinks by 30 to 60 percent.
- Paste a logo, choose “React (TSX)”, and get a typed component that accepts size and colour props.
- Turn a small icon into a CSS background data URI to inline it in a stylesheet without an extra request.
Frequently asked questions
Is my SVG uploaded anywhere?
No. The file is parsed and converted inside your browser and is never sent to a server.
Is it safe to open an SVG from someone else?
The tool never inserts your SVG into the page. The preview is drawn as an image, where scripts do not run, and scripts, event handlers and javascript: links are removed from everything you copy or download.
Why does it not merge paths or flatten transforms?
Those changes save bytes but can alter how the drawing renders or break a reference. The optimiser stops before anything that risks changing the result.
How do I convert an SVG into a React component?
Choose “React (JSX)” or “React (TSX)”. Attributes are renamed to their JSX form, class becomes className, and {...props} is passed to the root so you can set size and colour where you use it.