Skip to content
Browser tool Runs locally

SVG Optimizer

Clean up SVG markup with a conservative browser-side optimizer.

Optimize SVG markup

This is a conservative browser-side cleanup, not a full SVGO replacement. Untrusted SVG script and event-handler content is rejected rather than executed.

Worked example

The comment is removed. This compact example retains its dimensions and rectangle; review complex SVG visually before replacing an original.

SVG input

<svg xmlns="http://www.w3.org/2000/svg" width="8" height="6"><!-- note --><rect width="8" height="6"/></svg>

Expected result

<svg xmlns="http://www.w3.org/2000/svg" width="8" height="6"><rect width="8" height="6"/></svg>

How to optimize an SVG

  1. Paste valid SVG markup.
  2. Run the conservative optimizer.
  3. Copy or download the cleaned SVG.

What this optimizer changes

The tool removes XML comments, metadata elements and safe formatting whitespace in SVG element containers, then serializes the parsed SVG again. It deliberately avoids aggressive path rewriting or geometry changes, so it is not positioned as a full replacement for mature SVG optimization pipelines.

Metadata, accessibility, and viewBox

The cleanup removes metadata elements while preserving title and desc elements, including accessibility-oriented content. Whitespace inside text, CSS, attributes, and xml:space="preserve" regions is retained. The optimizer does not rewrite path geometry or intentionally change the viewBox; it is a cleanup pass rather than a geometry optimizer.

What it intentionally preserves

The implementation does not perform path simplification, coordinate rounding, geometry rewriting, or other aggressive optimization. It also does not execute pasted SVG. This conservative behavior makes the output easier to reason about than a tool that applies broad visual transformations.

SVG safety

SVG can contain active content. Odelvo does not execute pasted SVG and rejects script elements, inline event-handler attributes, and javascript: URLs before output is produced.

Frequently asked questions

Will this change the visual appearance of my SVG?
The optimizer is intentionally conservative. It removes comments, metadata elements, and formatting whitespace only in SVG element containers. Text, attributes, accessible titles, descriptions, and geometry are preserved.
Is this a full SVGO replacement?
No. It is a lightweight cleanup tool for common SVG markup, not a complete industrial SVG optimization pipeline.
Can I paste untrusted SVG?
The input is treated as untrusted text. Script elements, event-handler attributes, and javascript: URLs are rejected and the markup is parsed rather than executed.

Related tools