XML Formatter and Validator for Documents and APIs
Indent XML structures and check tag closing easily.
- Well-formed XML check
- Adjustable indentation from 1 to 8 spaces
- Warning for unclosed tags
- Character, line, and element count
- One-click copy
Validate and organize your XML with consistent indentation
Paste the XML, choose the number of spaces, and follow the formatting automatically. The tool checks the structure before producing the result.
Paste or type XML to format.
The formatted XML will appear here once the input is valid.
Fix the fields to format the XML.
Turn a one-line XML into something you can read
The formatter is for people dealing with electronic invoices, feeds, configuration files, and integrations that exchange XML.
- Read a compact XML received from an integration.
- Find the tag that was left unclosed.
- Standardize indentation before sharing an example.
How to use it
- 1. Paste the XML into the input field.
- 2. Choose the indentation, from 1 to 8 spaces.
- 3. Check whether the tool reports a syntax error.
- 4. Copy the formatted XML.
Structure is checked first, then formatting is applied
The browser reads the document and checks that it is well formed. Only then is each element placed on its own line, with the chosen indentation.
Well formed
Opened tags must be closed in the correct order.
A structural error stops formatting and shows a warning.
Indentation
Each inner level receives the chosen number of spaces.
The default is 2 spaces.
Element count
The tool shows document statistics, such as the number of elements.
This helps confirm nothing was lost when copying.
A compact XML
With 2-space indentation, the document below is rearranged into three lines.
<root><item>ok</item></root>
<root> <item>ok</item> </root>
Tag content is not changed: only line breaks and indentation spaces are added.
Well formed is not the same as valid
The tool checks XML syntax, not the rules of a specific format.
- There is no schema (XSD) or DTD validation: required fields of an invoice, for example, are not checked.
- The XML is not sent to any system; it is only read and formatted on the page.
- Very large documents may slow down the browser.
Frequently asked questions
What is the difference between well-formed XML and schema-validated XML?
Well-formed XML follows basic syntax rules such as closed, correctly nested tags. Schema validation also checks whether elements, attributes, and values follow a specific contract.