XML Formatter / Minifier / Validator

Format, minify and validate XML safely — preserve structure and content, nothing leaves your browser.

Category: Developer Tools

Input

All processing stays in your browser. XML is never executed or uploaded.

Indentation for Format
0 chars · 0 B
— —

About this tool

XML Formatter/Minifier/Validator uses DOMParser for well-formedness checks and source-preserving surgery where safe. No external DTDs are loaded, no entities resolved externally, and nothing is executed.

  • Preserves declarations, namespaces, comments, PIs, CDATA, attributes, entities.
  • Never fetches external DTDs or resolves external entities.
  • Refuses unsafe transforms (DOCTYPE/entity cases where preservation cannot be guaranteed).
  • Validates well-formedness only — no XSD/Relax NG/DTD schema validation.
  • Format with 2 spaces, 4 spaces, or Tab indentation; only safe structural whitespace is added.
  • Minify conservatively — remove only whitespace proven insignificant; preserve text nodes and mixed content.
  • Validate well-formedness with DOMParser; report errors with line/column where available.
  • Preserve XML declarations, processing instructions, comments, CDATA, namespaces, attributes and entities.
  • Handle DOCTYPE safely — never fetch external DTDs or resolve external entities.
  • Copy input/result, swap, clear, download formatted.xml/minified.xml/validation-report.txt; 1 MB limit.