Shrink an Icon Library with Optimize SVG Files

By the Axialis Engineering team ·

Shrink an Icon Library with Optimize SVG Files

Icons that come out of a design tool carry a lot of air: pretty-printed indentation, six-digit colors that fit in three, coordinates written as 10.000. None of it draws anything, and on a site that inlines two hundred icons it adds up. IconVectors 2.1+ adds Optimize SVG Files to the Icon Explorer's batch menu so a whole folder can be compacted in one pass, with a preview that tells you the savings per file before a byte is written.

This guide is for IconVectors 2.1+ (Windows today, macOS and Linux with 2.10). The command rewrites the selected files in place, so it starts, like every modifying batch, with a copy.

Bars compare file sizes before and after; two files shrink and one already compact file is left untouched; a markup sample shows spacing, hex colors and path numbers compacted Planned byte savingsbeforeafterarrow.svg4.1 KB2.6 KBchanged, -37%cloud.svg6.8 KB4 KBchanged, -41%dot.svg0.4 KB0.4 KBunchanged: already compact, bytes and timestamp keptbefore<path fill="#ff0000" d="M 10.000 20.000 L 14.000 24.000" />after<path fill="#f00" d="M10 20l4 4"/>same drawing, same IDs, fewer bytes
The preview reports the savings per file before anything is written. A file whose compact form would not be smaller is left byte for byte as it was, timestamp included. The markup sample shows the three safe optimizations: compact formatting, shorter hex colors, shorter equivalent path numbers.

1. Work on a copy or a committed folder

Press F5, open the folder in the Icon Explorer, select the icons and use Group in Folder... with the move option off to copy them into a child folder, then run the batch there. If the folder is under version control and clean, that is the other acceptable safety net: a bad result is a git checkout away. The batch stages and validates every file and rolls back on failure, but there is no Editor Undo for a batch that succeeded.

2. Select the files and open Optimize SVG Files

Select the icons (Ctrl+A in the grid takes every visible one) and choose Explorer -> Batch Processing -> Optimize SVG Files.... A selected file that is open in the Editor blocks the batch; close it or deselect it.

3. Choose the optimizations

Four independent options. The first three are safe in the sense that the drawing cannot change; the fourth can.

At least one option has to be on. The choices are remembered across runs and across IconVectors windows.

4. Read the preview

Click Preview Changes. The Confirm Optimize SVG Files dialog lists the options, the selected and hidden counts, every file with its state, before and after thumbnails drawn in the same fixed color, and the planned byte savings. Three things to look for:

Back returns to the options with the selection kept, so turning rounding off and previewing again takes a few seconds.

5. Apply and compare in git

Click Optimize SVG Files. Output is staged and validated, then committed over the originals; a failure rolls back and reports any recovery file it had to keep, and the final savings count only files that were actually committed. In a git working copy, run git diff --stat afterwards: you should see only the files the preview listed as changed, and the rendered diff of any one of them should show the same drawing.

What this command does not do

It is a safe compactor, not a sanitizer. It keeps IDs, references, definitions, metadata, license comments and canvas dimensions; it does not remove unused definitions, flatten transforms, merge paths or rename anything. For the structural cleanup that a deliberately exported icon deserves, use the Editor's analysis and cleanup tools on the single file, as in Analyze and Clean Up Icons Before Export, and the Editor's Export Minified SVG for the most aggressive single-file output. The batch is for the other two hundred files.

An MCP client runs the same thing through explorer_batch_optimize_svg_files with a plan and an apply step. Download the IconVectors 2.10 trial for Windows and try it on a copy of your icon folder; the preview tells you the savings before you commit to anything.

Related guides

Start Making SVG Icons Today with IconVectors

Download the fully-functional 30‑Day Free Trial and unlock your icon design workflow.

Version 2.10 for Windows - October 6, 2026. macOS and Linux: version 2.00 available now, 2.10 coming soon.