# SVG Optimizer > Shrink and sanitise SVG files: strip editor junk and scripts, round numbers, minify paths. Optimises an SVG file in your choice of steps and shows how many bytes each one saved: removes comments, metadata and Inkscape/Illustrator editor data, hidden and empty elements, rounds numbers, rewrites path data in its shortest form and collapses whitespace. It also removes scripts, event handlers and external references, so the result is safe to embed. Part of usefulweb.site (https://usefulweb.site/). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://svgoptimizer.usefulweb.site/ (interactive tool at https://svgoptimizer.usefulweb.site/tool) - JSON API: POST https://svgoptimizer.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://svgoptimizer.usefulweb.site/api/v1/tool) - OpenAPI: https://svgoptimizer.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://svgoptimizer.usefulweb.site/mcp - tool `svg_optimizer` ## Inputs - svgFile (file): SVG file - An .svg or .svgz file, max 5 MB. Alternatively paste the SVG code below. - svgText (textarea): Or paste SVG code - precision (integer): Decimal places - Coordinates and lengths are rounded to this many decimals. 1–3 is usually invisible; transforms keep two more. - minifyPaths (boolean): Minify path data (shortest relative/absolute commands) - removeHidden (boolean): Remove hidden elements and unused definitions - removeDimensions (boolean): Remove width/height (keep viewBox so the SVG scales responsively) ## Method - The SVG is parsed by a strict built-in XML parser (no external entities; internal DOCTYPE entities are expanded once with a size cap, which blocks "billion laughs" files). The document is re-serialised after every step, and the byte count before/after each step is reported. - Security (always on): removes