Remove Empty Attributes From SVG

Delete attributes whose value is empty (id="", class="")

Remove XML declaration? Remove XML declarationClean Illustrator SVG? Clean Illustrator SVG

FAQ

Quick answers

Which empty attributes get removed from SVG?
Any attribute whose value is "" or only whitespace — id, class, data-*, and others.
Is an empty attribute the same as a data- attribute?
No. Empty means blank value. Remove Data Attributes deletes every data-* key, even when it has a value.
Do empty presentation attributes like stroke="" count?
Yes. Blank stroke/fill attributes are removed.
Will xmlns stay when I remove empty attributes?
Yes. xmlns has a real value and is kept.
Remove XML declaration → Clean Illustrator SVG → Clean Figma SVG → Remove hidden layers →
Open full editor →

Source

Type or paste SVG markup. The preview on the right updates as you type.

Ready

Live preview

PNG export · 2× for retina