XML Formatter

Lays XML out with lines and indentation, keeps element text untouched, verifies against the source, and explains errors with line, column and a hint.

The file never leaves your device: parsing, formatting, and verification all run in the browser. The file encoding is read from its first line, so Windows-1251 exports open without mojibake.

Each element goes on its own line, indented by nesting level; comments and processing instructions get the same treatment. The reverse button squeezes the whole document into one line: that way it weighs less and sits better inside code.

Text inside elements stays exactly as it was: no trimmed spaces at the edges, no line breaks added. Entities like & and   are not expanded, and CDATA sections are left untouched.

Errors in plain words, with a hint

When the markup is wrong, you see the line, the column, a piece of the source with a pointer to the spot, and an explanation of what to do.

A bare ampersand: replace it with &amp;. The entity &nbsp; does not exist in XML; write &#160; instead. The tag </item> does not close <Item>: XML is case-sensitive.

A second root element, an attribute without quotes, a repeated attribute, an undeclared prefix, a control character from a database dump: each error comes with its own explanation.

The browser's built-in parser offers a second opinion: if it accepts what our parser rejected, the page says so.

The document is known by its root

A sitemap, an index of sitemaps, a YML price feed for Yandex Market, an RSS or Atom feed, a CommerceML exchange with 1C, SVG, SOAP, XSLT: the root element tells you what the file is, and its entries are counted. A sitemap longer than 50,000 URLs gets flagged: search engines won't accept one like that.

Rate this tool

Help us get better

Other tools