DEADeveloper Engineering AtlasDeveloper workspace

Local · Your input stays in the browser

XML Formatter and Syntax Checker

Parse XML, report structural errors, and apply consistent indentation.

Workspace

Guide and technical reference

How to use

A browser DOMParser builds a document tree, then the formatter serializes elements with two or four spaces while preserving mixed content as one serialized block.

  1. Paste XML and choose two or four spaces.
  2. Fix any parser error before using the output.
  3. Review mixed content, declarations, comments, CDATA, and DOCTYPE needs.

Examples

Input
<p>Hello <b>DEA</b>!</p>
Output
<p>Hello <b>DEA</b>!</p>

Mixed content remains inline to avoid changing text spacing.

Input
<root><item>1</item></root>
Output
indented root and item

Element-only content is reformatted.

Input
<root><item></root>
Output
Parser error

Mismatched tags are rejected.

Understanding the result

Well-formed means the XML parser accepted one document tree.

This tool does not validate XSD or DTD constraints.

Common errors and limitations

  • The output is not guaranteed byte-for-byte lossless.
  • Formatting can omit an XML declaration or DOCTYPE because only the document element is rendered.
  • External schema validation is not performed; processing is local.

Frequently asked questions

Does this validate an XSD?
No. It checks XML well-formedness only.
Why is mixed content not expanded?
Whitespace inside mixed text and elements can be meaningful.

← Back to all tools