How to use XML Formatter & Inspector
Validate XML syntax and optionally indent element-only XML locally without external entity resolution.
About XML Formatter & Inspector
XML documents use nested elements, attributes and text with strict well-formedness rules. A syntax inspector helps identify malformed markup, while formatting can make structured documents easier to inspect. This workspace parses in an isolated browser document and returns text; it does not render supplied XML or HTML in the application.
Choose inspect or format, paste XML, and review the result. DTDs, entity declarations and stylesheet instructions are rejected. Formatting indents element-only content and leaves mixed content, CDATA and xml:space preservation regions untouched. Formatting can change whitespace-only nodes; keep originals for signed or whitespace-sensitive XML. Documents containing an element named parsererror are conservatively rejected to avoid accepting browser-generated error markup.
- Choose inspect or format, paste XML, and review the result.
- Select or enter the labeled options, then run locally.
- Review the result, limitations and worked example before copying or exporting.
How it works
Use DOMParser for well-formedness, then XMLSerializer; optional indentation modifies whitespace between elements within bounded depth and node counts.
A quick example
<root><item>Example</item></root> can be inspected or indented for readability.
Assumptions, edge cases & limits
- Choose inspect or format, paste XML, and review the result. DTDs, entity declarations and stylesheet instructions are rejected. Formatting indents element-only content and leaves mixed content, CDATA and xml:space preservation regions untouched. Formatting can change whitespace-only nodes; keep originals for signed or whitespace-sensitive XML. Documents containing an element named parsererror are conservatively rejected to avoid accepting browser-generated error markup.
- This workspace does not save inputs. Use synthetic or redacted data and verify output before production use.
Questions about XML Formatter & Inspector
How do I check XML for malformed tags?
Paste the XML and review syntax or parsing errors. Well-formed XML does not necessarily satisfy a domain-specific schema.
Does this validate XSD schemas?
No. It checks well-formedness only.
Can formatting change XML whitespace?
Yes, between elements. Mixed content and preservation regions are not reformatted.
Does it fetch external entities?
DTD and entity declarations are rejected, and no external resolution is performed by the tool.
Can I preview arbitrary HTML or scripts?
No. Output is displayed as text only.
For processing, privacy and service availability, see our privacy details and methodology. Tool-specific questions and limitations are explained above.
A result or explanation needs correcting? Tell us the tool name and an example.