XML Formatter
Pretty-print, minify and validate XML, SOAP envelopes and RSS feeds.
Runs fully in your browser. Nothing you paste here is sent anywhere.PrivateInput
Output
About this tool
Two editable panes side by side: paste on the left, read the indented result on the right. Both sides have line numbers and syntax colouring, both stay editable, and the output updates as you type. A minified SOAP envelope or a feed that arrived as one 40 KB line becomes a tree you can actually read, and the status bar reports how many elements it holds and how deep they go.
The formatter only re-indents where whitespace cannot be content. An element whose children are all elements gets one child per line; text stays on its element’s line; mixed content such as a paragraph with a tag inside it is left as written apart from the whitespace at its two ends; and anything under xml:space="preserve" is returned byte for byte. Entities and CDATA sections are never resolved — < is content, and a formatter that decoded it would hand back a document that no longer means the same thing.
Input that is not quite XML is still accepted and the repair is reported rather than applied silently: unquoted attribute values, HTML-style attributes with no value, documents with more than one root, and payloads that arrived backslash-escaped, percent-encoded or wrapped in quotes by a log pipeline. Attributes declared twice are flagged instead of being quietly dropped. When a document genuinely cannot be parsed — a closing tag that matches nothing, an unterminated comment — the exact token is underlined in place, its line number turns red, and one button scrolls to it and selects it.
Nothing you paste is transmitted. The page is static HTML and the parsing happens in your tab, which makes it safe for SOAP traffic, invoices, configuration files and anything else you would not paste into a server you do not control.
Frequently asked questions
Is my XML uploaded to a server?
No. The formatter is plain JavaScript running in your browser. There is no backend endpoint, so your data never leaves your device — you can disconnect from the network and it still works.
Does formatting change what the document means?
No. Entities, CDATA sections, comments and attribute values are passed through exactly as written, and whitespace is only changed where it cannot be significant. Text mixed with markup is left alone, and an element carrying xml:space="preserve" is returned unchanged. The two options that do rewrite something — collapsing empty tags and sorting attributes — are off until you turn them on.
What do "collapse empty tags" and "sort attributes" do?
Collapsing rewrites an element with no content as a self-closing one, so <item></item> becomes <item/>. Sorting reorders every element’s attributes alphabetically, which makes two documents directly comparable before diffing them. Neither changes the data the document carries.
Will it format invalid XML?
Often, yes. Unquoted attribute values, valueless attributes, several root elements and escaped or percent-encoded payloads are all accepted, and the status bar says the input was repaired. What it will not guess at is a missing or mismatched closing tag: that is reported by line and column with the element it expected, because inventing the missing tag would be inventing your data.
Does it validate against a DTD or an XSD schema?
Not yet. It checks that a document is well formed — tags balanced, attributes quoted, markup terminated — which is what catches the overwhelming majority of broken XML. Validating against a schema is on the roadmap, as is converting XML to JSON.
How large a file can I format?
The limit is your browser memory rather than an upload cap. Documents of a few megabytes format in well under a second; past roughly 400 KB the syntax colouring switches off to keep typing smooth, and the text stays fully editable.
Is it really free?
Yes, with no account and no usage limit. The site is funded by ads placed around the tool, never inside your working area.