# SVG optimizer

> Clean up SVG markup and remove unnecessary metadata.

[Open tool](https://www.toolcabana.com/mt/svg-optimizer) · [Stampi u disinn](https://www.toolcabana.com/mt/category/images-and-design)

Tool ID: svg-optimizer. Requested language: mt. Description language: en. Complete guide translation: no; untranslated sections use English.

## Overview (en)

SVG optimizer cleans pasted SVG markup by sanitizing it and removing metadata elements, comments and whitespace-only text, while keeping title and description elements. It shows the byte count before and after, previews the result and lets you download optimized.svg. Scripts, style attributes, embedded images and animations are stripped during sanitizing.

## Supported tasks (en)

Clean up SVG markup and remove unnecessary metadata.

## Steps (en)

1. Paste the source into the input editor, or load the built-in example.
2. Check the source format before running the operation.
3. Run svg optimizer, review the output, then use the available copy or download controls.

## Settings

No additional settings.

## Limitations (en)

Images are limited to 32 megapixels and 16,000 pixels per side. Most operations accept one source; supported batch operations produce a ZIP archive.

## Example input

```text
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="300" viewBox="0 0 400 300"><rect width="400" height="300" fill="#f5ede6"/><circle cx="200" cy="150" r="80" fill="#ed854b"/></svg>
```

## Privacy and connections (en)

This operation processes its source in your browser. Copy and download are explicit actions; source input is not saved in an account or history.

## Questions (en)

### Does SVG optimizer change path data or round numbers?

No. It does not rewrite paths, merge shapes or reduce decimal precision. Savings come from removing metadata, comments, whitespace-only text and forbidden markup, so the size change depends on how much of that the file contains.

### Why did my SVG lose its styles after optimizing?

Style elements and style attributes are removed by the sanitizer, along with script, foreignObject, image, use, a and animation elements. Convert CSS styles to presentation attributes such as fill and stroke before optimizing to keep them.

### Is the optimized SVG safer to embed on a website?

The output is sanitized with DOMPurify's SVG profile, scripts are removed, and href attributes and external url() references are stripped. Internal references such as url(#gradient) are kept.

### Where is my input processed?

This operation processes its source in your browser. Copy and download are explicit actions; source input is not saved in an account or history.

### What are the input limits?

Images are limited to 32 megapixels and 16,000 pixels per side. Most operations accept one source; supported batch operations produce a ZIP archive.

## Related tools

- [SVG to PNG](https://www.toolcabana.com/mt/svg-to-png)
- [Gradient generator](https://www.toolcabana.com/mt/gradient-maker)
- [Image to Base64](https://www.toolcabana.com/mt/image-to-base64)
- [Contrast checker](https://www.toolcabana.com/mt/contrast-checker)
