XML FormatterDeveloper Tools
Beautifies XML with clean indentation or minifies it to one line.
Make minified or messy SVG code readable again. The SVG formatter indents every element, can put each attribute on its own line, and never changes a value.
Formats as you type for files up to 200 KB. Text and attribute values are never changed.
The file is read by a strict XML parser, the same one the XML Formatter uses, and written back with new line breaks and indentation.
<text> and <title>, keep their content on one line, so spaces inside text are not changed.If the XML is broken, you get the line and column of the first error instead.
This one-line icon:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none"><circle cx="12" cy="12" r="4"/></g></svg>becomes:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<g fill="none">
<circle cx="12" cy="12" r="4"/>
</g>
</svg>With one attribute per line, cx, cy, and r each get their own line under <circle.
d is not split or reformatted.<style> is kept as it is. For CSS, use the CSS Formatter.Only the whitespace between elements. Values, text, and the drawing stay the same, so the file looks identical in a browser.
The file is not well-formed XML, for example a tag is not closed or an ampersand is not escaped. The error shows the line and column so you can fix it.
Copy just the part from <svg> to </svg> and paste it here. For whole HTML documents, use the HTML Formatter.
Yes for editing and code review: long elements become easy to scan, and a change to one attribute shows up as a one-line difference in version control.
Often used together with the SVG Formatter.
Beautifies XML with clean indentation or minifies it to one line.
Checks SVG files for XML errors, broken references, typos, and unsafe code.
Minifies SVG code to the smallest version that draws the same.