SVG Optimizer and Cleaner

Clean a restricted SVG subset and compare optional numeric precision changes before download.

Files stay on your device No sign-up Free to use
How this works

The tool runs in this browser. Your file or text is not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.

Privacy details

Inspect input controls

Showing an example. Edit to see your own.

Paste a static SVG or choose a file below. Up to 256 KiB, 2,000 elements and 32 levels. Basic shapes, paths and text only; scripts, CSS, external references, images, use, gradients and filters are refused.

Drop your image here

or choose one from your device

When selected, this file is used instead of the source box.

    Rounding can change shapes and is off by default. Compare both previews before using the output.

    Text, titles, descriptions and xml:space="preserve" content retain their whitespace. Comments and SVG metadata are always removed.

    Processed in your browser. Your inputs stay on this device.

    How to use SVG Optimizer and Cleaner

    1. Paste a supported SVG document.
    2. Choose structural whitespace cleanup and optional coordinate rounding; comments and metadata are always removed.
    3. Compare the safe baseline and cleaned previews before downloading, and retain the original file.

    Example: SVG Optimizer and Cleaner

    A simple SVG rectangle with a comment and metadata.

    You add
    SVG source: <svg xmlns="http://www.w3.org/2000/svg" width="320" height="160" viewBox="0 0 320 160"> <!-- A simple local drawing --> <rect x="10.1234" y="10" width="299.8766" height="140" rx="12" fill="#eef2ff" stroke="#334155"/> <text x="28" y="88" font-family="sans-serif" font-size="24" fill="#172033" xml:space="preserve">Keep this text</text> </svg> Coordinate decimal places: keep Remove whitespace between shapes: on
    You get
    Cleaned 3 SVG elements: 348 input bytes → 307 output bytes. Sample rows: Input bytes | 348; Output bytes | 307.

    Options

    Source choice
    Use the source box or choose a supported SVG file. A selected file takes precedence over pasted markup. The page refuses features outside its static drawing subset.
    Decimal places
    Keep coordinates unchanged unless rounding is intentional. Removing inter-element whitespace preserves text whitespace, but rounding can visibly alter geometry.

    Supported inputs and limits

    Up to 256 KiB, 2,000 elements and depth 32 in the supported SVG subset. Scripts, events, external references and unsupported constructs are refused. Both exported previews omit comments and metadata; keep the original file. Significant text whitespace is retained. Rounding can change geometry; compare the previews. Output is not guaranteed smaller. The current subset refuses CSS, gradients, filters, images and use references.

    Where your input is processed

    This tool processes your input in this browser. Your text and files are not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.

    Compare the output before replacing an asset

    Comments and metadata are removed even when coordinate precision is kept. That can matter if the original carried attribution or editorial notes, so retain any information required by the asset’s licence separately. Compare both previews and the actual output; a supported cleanup may produce a larger file and does not certify that an SVG is safe in every application.

    Questions about SVG Optimizer and Cleaner

    Can rounding alter the picture?

    Yes. Precision reduction is an explicit option and needs visual review.

    Will SVG scripts or external resources run?

    No. Unsafe or unsupported constructs are refused before preview.

    Can cleanup increase the file size?

    Yes. Serialization and a small original file can produce a larger result; compare the reported sizes.

    Project manager: Tony Hines · Content updated 4 October 2026 · Report a problem