Format & beautify XML online: pretty-print or minify
Turn a one-line or copy-pasted XML blob into clean, indented markup. Yellorn's Data Doctor repairs unclosed tags, unescaped ampersands, and fences first — then pretty-prints, all in your browser.
From a one-liner to readable XML
XML copied out of a log line, an API response, or a config export often arrives as one long line — or worse, wrapped in a markdown fence with a stray byte-order mark. Yellorn pretty-prints it into clean, indented markup, in your browser, in one click.
How to format XML
- Paste your XML into the editor. Yellorn auto-detects the XML format — or pick XML from the format selector.
- Press Cmd + Shift + F (Smart Format) or click Smart Format in the toolbar.
For example, this:
<order id="42"><item sku="A1">Widget</item><item sku="B2">Gadget</item></order>
becomes this:
<order id="42"> <item sku="A1">Widget</item> <item sku="B2">Gadget</item> </order>
What Smart Format repairs
Smart Format runs a conservative best-effort repair pass before it pretty-prints, so lightly-broken XML still formats instead of throwing an error. It:
- strips a markdown
```xmlfence and pulls the XML out; - removes a leading byte-order mark that derails the parser;
- patches tags missing their closing
>; - auto-closes tags still open at the end of the document;
- escapes stray
&characters in text content.
Every change is listed in the status bar as Auto-fixed: …, so nothing is reshaped behind your back. Simple Format (Alt + Shift + F) skips the repair pass when you want layout changes only.
Minify, convert, or explore the structure
To go the other way, Compress (Alt + Shift + C) strips insignificant whitespace and collapses the document to a single line — useful for embedding XML in code or shrinking a payload.
Because Yellorn parses the XML into a shared structure, you can also convert it to JSON, YAML, or CSV from the Convert to… menu, and explore it as a collapsible tree or a node graph beside the editor. Everything runs locally; your XML is never sent to a server.
Frequently asked questions
How do I format XML online?
Paste your XML into Yellorn — it auto-detects the XML format, or you can pick XML from the format selector — and press Cmd/Ctrl + Shift + F (Smart Format). Yellorn returns clean, indented XML with consistent nesting in your browser. Nothing is uploaded to a server.
Can Yellorn fix broken or invalid XML?
Yes. Smart Format runs a best-effort repair pass before pretty-printing: it strips markdown ```xml fences and a byte-order mark, closes tags left open at the end of the document, patches tags missing their closing angle bracket, and escapes stray & characters in text — then reports each fix in the status bar.
How do I minify XML?
Use Compress (Alt/Option + Shift + C) to strip insignificant whitespace and collapse the document to a single line — handy for embedding XML in code or shrinking a payload. Smart Format does the reverse, expanding a one-line document back into readable, indented markup.
What is the difference between Smart Format and Simple Format?
Smart Format (Cmd/Ctrl + Shift + F) repairs common paste damage — markdown fences, a BOM, unclosed tags, unescaped ampersands — and then pretty-prints. Simple Format (Alt/Option + Shift + F) pretty-prints without the repair pass, for when you want the formatter to leave your input untouched apart from layout.
Is my XML uploaded to a server?
No. Formatting, repair, and conversion all run in your browser, so the XML is never sent anywhere. You can also convert formatted XML to JSON, YAML, or CSV from the Convert to… menu, and explore its structure as a collapsible tree or a node graph.
Related
Where to go next
Try a fix in the editor or browse more articles.