AAllMyToolsa pocketful of little tools
XML

XML formatter

DevNo. 92 / 93

Format, minify and validate XML in the browser. See the parser error when a document is malformed, and get a clean copy without uploading anything.

a namespace is not a decoration. it is the whole document.

work surface

Math, not advice — results are indicative.Read the disclaimer.

most-used utilities

A SOAP response

Indent a one-line envelope to see which element actually failed, without sending the payload anywhere.

A config export

Format an exported XML config and diff it against the previous version.

A size limit

Minify before pasting into a system that rejects files over a few kilobytes.

pro tips

Mixed content — text and tags in the same element — gets reindented, which can add visible spaces. Minify instead if the document is meant to be read by a person as HTML.

A "parsererror" with no line number usually means mismatched tags. Search for the closing tag rather than the opening one.

Minified XML is not smaller over the network if your server already gzips it; the win is in storage and in tools with size limits.

what it does

Paste an XML document and get it indented, with one element per level and attributes left in place. The minify button does the opposite: it removes the whitespace between tags so the document travels as small as it can.

Validation uses the browser's own XML parser, the same one that decides whether a document is well-formed before any application touches it. If the document is broken, the parser error is shown instead of a silent empty output — which is the difference between fixing it and guessing.

It is well-formedness, not schema validation. The tool tells you the document is structurally valid XML; it does not know your XSD, your namespaces rules or whether `orderId` is supposed to be a number. For that you need a schema validator.

Everything runs locally. SOAP envelopes, configuration files and exported data often carry credentials or customer records, and an XML formatter on a server sees all of it.

quick answers

Is my XML uploaded?

No. It is parsed by the browser's DOMParser and formatted in the tab. Nothing is sent to a server.

Does it validate against an XSD?

No. It checks that the document is well-formed XML. Schema validation requires your XSD and a dedicated validator.

Why does formatting change the spacing inside my text?

Pretty-printing adds indentation between elements, and mixed content — text next to a tag — gets whitespace around it. Use minify if the whitespace is part of the content.

What does the error mean?

It is the browser's XML parser message: usually a mismatched or unclosed tag, an unquoted attribute or an illegal character. The message points at the element it gave up on.