How to format or validate XML
- Paste your XML, or open an .xml file.
- Choose Format to beautify it with 2 spaces, 4 spaces, or tabs, or Minify to shrink it.
- Fix any error shown with its line and column, then copy or download the result.
The status line under the editors tells you whether the XML is well-formed. Long text values stay on one line so the structure is easy to scan.
Questions
Is my XML uploaded?
No. The XML is checked and formatted in your browser, so configuration files, feeds, and documents stay on your device.
How does validation work?
The page checks that your XML is well-formed: tags are closed in the right order, attributes are quoted, and there is one root element. If something is wrong, you get the line and column of the first problem. It does not check against an XSD or DTD schema.
Does formatting change my data?
No. Only whitespace between tags changes. Attributes, entities such as &, comments, and CDATA sections are kept exactly as written.
What does minify do?
It removes the line breaks and indentation between tags, and optionally comments, to make the file smaller. Text inside elements is left untouched.
Can it format SVG, RSS, or other XML files?
Yes. Any XML-based format works, including SVG, RSS, Atom, sitemaps, KML, GPX, and plist files.
Credits
Built on fast-xml-parser (MIT). OneTooling is not affiliated with that project.