How it formats
Each element whose content is only child elements gets one line per child, indented one level deeper. An element with text stays on one line, and an element that mixes text and child elements (as in XHTML or DocBook) keeps its content untouched, because the spaces in it are part of the text. So does an element marked xml:space="preserve".
The formatter reads tags rather than building a DOM, so it never rewrites what you wrote: stays an entity, a CDATA section stays a CDATA section, single-quoted attributes keep their quotes and the DOCTYPE keeps its internal subset.
Minifying XML
Minify removes the whitespace between elements, and comments unless you keep them. Text is not trimmed: a value with spaces inside an element keeps them. The size before and after is shown under the result.
When the XML is broken
A tag that is not closed, or closed in the wrong order, stops the formatter with the line and column of the problem. For a full check (undeclared entities, attribute syntax, encoding) and a schema check, open the document in the validator.
Questions
Is my XML uploaded?
No. The formatter is JavaScript running in your browser tab; the document never leaves your machine.
Does formatting change my data?
Only the whitespace between elements. Text, attribute values, CDATA sections and comments are kept as they are, and mixed content is left alone.
How large can the document be?
Up to 20 MB. Larger files format too, but the editor gets slow; the validator handles files up to 1 GB.
Other tools
- XPath tester: Evaluate XPath 3.1 against a document and see each match with its line.
- XSD generator: Infer an XML Schema from sample documents, checked against them.
- XML from XSD: Generate a sample XML document from a schema, validated against it.
- XSLT transformer: Run XSLT 1.0, 2.0 or 3.0 on a document and see the result, the messages and the files it writes.
- XML diff: Compare two XML documents as trees: changed, added and removed elements, attributes and text.
- XML to JSON converter: Convert XML to JSON, with arrays where an element repeats or wherever its XSD allows.
- JSON to XML converter: Convert JSON to XML: @keys become attributes, arrays repeated elements.
- XML to CSV converter: Turn a repeating element into CSV rows: invoice lines, products, records.
- E-invoice viewer: Read an XRechnung, ZUGFeRD, Factur-X or Peppol invoice as a document, and print it.
- XML validator: check a document against XSD, DTD, RelaxNG or Schematron, up to 1 GB.