Instant XML Formatting
Prettify messy markup with clean line breaks and multi-space indentation.
SVG Tools / SVG Minifier & Prettifier
Free · Format · Private
Format messy inline vector code with custom XML indentation, or compress it into a single line for web embedding. Fast, private, and executed 100% in your browser.
Run SVG Minifier & Prettifier entirely in your browser. Files stay on your device — nothing is uploaded to process this tool.
Launch SVG Minifier & PrettifierFree accounts get 3 Collections. Organize icons from the library and your workflow, then unlock bulk export with Pro.
Keep SVGs readable for editing, or crush them into compact strings for HTML and JSX.
Prettify messy markup with clean line breaks and multi-space indentation.
Collapse SVG into a compact one-line string ready for inline HTML or JSX.
Pick 2, 4, or 8 spaces so formatted output matches your codebase style.
Collapse self-closing tags, sort attributes, and strip comments when you need cleaner output.
Switch between formatted source and a live preview of the resulting graphic.
Minifying and formatting never hit a server. Your code stays local.
Format SVG markup in three steps
Bring in a file or paste inline SVG from your editor.
Set indentation and toggles for readable XML, or switch to single-line compression.
Grab the formatted output for HTML, React, Vue, or design handoff.
Everything you need to know about SVG minifying & prettifying
Prettifying formats messy SVG with clean multi-line indentation (2, 4, or 8 spaces) so developers can read and edit it. Minifying strips unnecessary whitespace into a compact single line ideal for inline HTML or JSX.
No. Minifying only removes redundant spaces, newlines, and optional comments. SVG tags, path data, colors, and coordinates remain intact and render the same.
Yes. Choose 2, 4, or 8 spaces for XML formatting, and use toggles for self-closing tags, attribute sorting, and comment removal.
Yes. Formatting and minification run locally in your browser with client-side JavaScript. Your code is never sent to an external server.
Select Minify mode, then copy the formatted output (or related Data URI helpers where available) and paste it directly into HTML, JSX, or CSS.