XML Formatter & Validator

Pretty-print XML with exact validation: mismatched tags, unquoted attributes and unclosed comments are reported with line/column positions.

Developer Tools 100% in your browser
Click to choose a fileor drag & drop it here — or paste the markup below

How to use

  1. Paste XML or choose an .xml file.
  2. Pick the indentation and press Format & validate.
  3. Read the formatted result, or fix the reported line/column error.

Example

Input: <root><a x='1'>short</a></root>

Output: formatted with 2-space indent + 'Well-formed' confirmation

How it works

The XML is parsed and re-printed with consistent indentation. Malformed XML reports the parser's error instead of a formatted result.

Limits & compatibility

  • Checks well-formedness only — no DTD/XSD schema validation.
  • Attribute quoting is normalised to double quotes; entity references are preserved as written.
  • Whitespace-only text between elements is collapsed away.

Privacy

Tokenised and formatted locally in your browser. Nothing is uploaded or stored.

Related tools

FAQ

Questions about XML Formatter & Validator

Is my input private?

Yes. This tool runs entirely in your browser — your input never leaves your device, is never uploaded to a server and is never stored.

How accurate is the result, and what are the limits?

The tool page states its formula and limits openly. Check them before relying on a result, and verify anything consequential — financial, legal, medical or safety-critical — against an authoritative source.

What happens to files I open with this tool?

Files are processed locally in your browser and never uploaded; closing the tab discards them. Text tools never store what you paste — it lives only in the page while you use it.