About XML Formatter / Validator
Validate well-formed XML locally before applying configurable indentation and optional inline text-content formatting.
XML Formatter validates well-formed XML before reindenting it. It reports the parser line and column for malformed input and can keep simple text content inline when compact readability is preferred.
How to use it
- Paste XML and choose indentation.
- Validate it directly or format only after syntax validation passes.
- Copy or download the formatted XML.
Common use cases
- Inspect compact API payloads or configuration files.
- Locate mismatched or unclosed XML tags before an import.
- Normalize indentation before reviewing XML in source control.
Worked example
Locate a mismatched closing tag in a compact API response, then format the corrected document.
Limitations and responsible use
- Validation checks XML syntax, not an XSD, DTD business contract, or namespace-specific rules.
- Formatting can change insignificant whitespace and should not be applied blindly to whitespace-sensitive documents.
- External entity resolution is not performed by this browser tool.
Frequently asked questions
Does valid XML mean it matches my schema?
No. Well-formed XML can still violate an application-specific XSD or other contract.
Can formatting change text values?
Indentation may affect whitespace-sensitive content, so review documents that rely on exact mixed-content spacing.