{{ summaryTitle }}
{{ summaryValue }}

{{ summaryLine }}

Profile{{ profileLabel }} References{{ resultsReady ? computation.values.reference_count : '—' }} ProcessingLocal only
SVG source and optimization profile
The source stays in this browser. Drop an SVG or TXT file onto the editor, or use Browse SVG below.

{{ sourceStatus }}

Use Safe for reusable artwork; choose Compact when this file is self-contained and external CSS or scripts do not depend on unused IDs.
Three decimals is the neutral default and balances compact output with common icon precision.
Safe keeps metadata; Compact removes it unless you explicitly preserve it.
Preserve every ID when external CSS, scripts, or authoring tools may refer to otherwise-unused IDs.
Removal also cleans matching ARIA ID references and adds a review warning.

{{ sourceExportStatus }}

Original · {{ formatBytes(computation.values.original_bytes) }}
Original SVG preview
Optimized · {{ formatBytes(computation.values.optimized_bytes) }}
Optimized SVG preview

Compare both renderings before download. Each preview uses an image blob URL, so the SVG is never inserted as active page markup.

{{ computation.values.optimized_svg }}

The chart renderer is unavailable. Exact byte values remain available in the optimization ledger.

CategoryMeasureValueReview noteCopy
{{ row.category }}{{ row.label }}{{ row.value }}{{ row.note }}

SVG files are XML documents that describe shapes, text, paint servers, reuse links, and accessibility text. Two drawings can render alike while carrying very different amounts of formatting, numeric detail, editor metadata, and identifiers. Removing that extra material can reduce transfer size and make the markup easier to inspect, but an aggressive rewrite can also break a gradient, a reused symbol, an animation target, external CSS, or an accessible name.

Safe optimization starts by separating changes that are usually structural from changes that depend on how the file will be used. Comments, an XML declaration, and formatting whitespace outside text-sensitive elements are often removable. Decimal rounding changes geometry, while deleting metadata, titles, descriptions, or apparently unused IDs can change editing, accessibility, or embedding behavior.

SVG optimization choices and their review implications
ChoicePossible benefitWhat can go wrong
Round numeric valuesShorter path, coordinate, and transform data.Fine geometry may shift when too few decimal places are retained.
Remove metadataLess non-rendered authoring data.Round-trip information needed by an editor may be lost.
Remove unreferenced IDsShorter markup in a self-contained file.External styles or scripts may still depend on those IDs.
Remove title and descriptionFewer descriptive elements and related references.The graphic may lose its accessible name or description.

File size is only one success measure. The optimized SVG should remain well-formed, preserve every required internal reference, and look and behave correctly in the place where it will be published. Keep the source file until that review is complete.

How to Use This Tool:

Choose the preservation policy before treating a smaller byte count as a finished result.

  1. Paste SVG markup, drop an SVG or TXT file onto SVG source, or browse for an SVG file no larger than 1,048,576 bytes.
  2. Select Safe cleanup for reusable artwork. Use Compact cleanup only when the SVG is self-contained and outside CSS or scripts do not rely on unused IDs.
  3. Open Advanced when numeric precision, metadata, IDs, or title and description content need an explicit policy. Three decimal places and preservation of accessibility text are the neutral choices.
  4. Read any validation message before reviewing the output. Active elements, event attributes, external resources, unsafe URLs, malformed XML, duplicate IDs, and broken required references are rejected rather than rewritten.
  5. Compare the original and optimized previews, then check Byte comparison and the warnings in Optimization ledger before copying or downloading the revised SVG.

Interpreting Results:

A positive Savings value means the serialized output uses fewer UTF-8 bytes. Zero means no conservative reduction was available. A negative value is possible when deterministic serialization makes the source longer, so smaller output is not guaranteed.

  • Review the actual preview, not only the percentage. Visual equality in one preview still cannot prove that an external stylesheet, script, or authoring application will behave the same.
  • Check the remaining element, attribute, ID, and required-reference counts when a preservation choice removed structure.
  • Treat every warning as a handoff check. Removed IDs and accessible text require review in the final embedding context.

Technical Details:

Conservative SVG cleanup is a parse, validate, transform, and revalidate process. The source must contain exactly one SVG root in the SVG namespace. Text inside text, text-path, style, title, and description elements keeps its significant whitespace, while formatting-only whitespace elsewhere can be removed.

Transformation Core:

Ordered SVG optimization stages
StageOperationPreservation rule
Structural validationTokenize XML, match tags, count depth, elements, and attributes.Require one SVG root, at most 5,000 elements, 30,000 attributes, and 128 nesting levels.
Safety validationReject active elements, event attributes, external resource links, unsafe CSS URLs, custom entities, and document type declarations.Only internal fragment references such as #paint and url(#paint) are accepted.
Policy removalOptionally remove metadata, title and description elements, and unreferenced IDs.Referenced IDs are retained; matching ARIA references are cleaned only when their title or description target is removed.
Numeric normalizationRound numeric tokens in geometry, coordinate, opacity, transform, and related numeric attributes to 1–6 decimal places.Non-finite tokens are left unchanged; negative zero becomes zero.
SerializationRemove comments, the XML declaration, non-sensitive formatting whitespace, and empty class or style attributes.The serialized result is parsed again before it is accepted.

Rule Core:

Safe cleanup follows preservation-first defaults. Compact cleanup removes metadata and unreferenced IDs unless an advanced override preserves them. Title and description removal is always an explicit choice. A required internal reference with no matching ID, or a duplicate or invalid ID, stops the transformation.

Formula Core:

The reported reduction compares UTF-8 byte counts before and after serialization and rounds the percentage to two decimal places.

S%= Boriginal-BoptimizedBoriginal ×100

Boriginal and Boptimized are UTF-8 byte counts. For example, reducing 142 bytes to 104 bytes saves 38 bytes, or 26.76% after rounding.

Privacy and Safety Notes:

The SVG source is processed in the current browser session and is not uploaded or placed in a shareable URL. The optimizer also refuses active and external content before previewing it.

  • Local processing does not make an unknown SVG trustworthy in every other viewer or publishing system.
  • Compact cleanup cannot discover references that live outside the file.
  • Removing title or description elements may reduce accessibility even when the visible drawing is unchanged.

References: