About SVG Optimizer
Design tools export SVGs with the editor's own metadata, six-decimal coordinates, an id on every group and a width and height that pin the size. SVGO removes what does not draw anything; the switches here cover the decisions that are yours — keep the title for screen readers, drop the dimensions so it scales, prefix ids so two icons on one page cannot fight — and the viewBox is never touched.
An SVG exported from a design tool carries a lot that never draws: an XML prolog, the editor's own namespaces and metadata, comments, an id on every group, coordinates to six decimal places, and a fixed width and height. SVGO is the standard tool for removing it, and it runs here in the browser on one file at a time, with the sizes before and after shown raw and gzipped, because a file that is served compressed shrinks by a different amount than its byte count suggests.
Most of SVGO's plugins are safe defaults and are left on. The switches cover the handful of choices that depend on how the file will be used. Stripping the title and description saves bytes but removes what a screen reader announces for an inline icon, so it is a choice, not a default. Removing width and height makes the SVG scale to its container, which is what an icon in a layout wants and what a fixed-size illustration does not. Prefixing ids matters the moment two optimised SVGs are inlined on one page and share a gradient id.
The viewBox is never removed. SVGO's older versions would drop it when it matched the dimensions, which saved twenty bytes and broke scaling; it is the one attribute that lets an SVG resize, and this tool pins it on regardless of the preset. Decimal precision is a slider because the right value depends on the artwork: three places is invisible on an icon, and a technical drawing may need more.
The second output is a React component. Attributes are converted to their JSX names — class to className, stroke-width to strokeWidth, xlink:href to xlinkHref — an inline style becomes an object, the prolog and comments go, and props are spread onto the root so the caller can set size and class. It is the conversion every icon library performs and everyone does by hand at least once.