<

Online XML Validator and Formatter

Check that your XML is well-formed and view it indented.

Ready
XML Input
Result Formatted

How to use the XML editor

Paste XML in the input panel. Your browser parses it with DOMParser: if the document is well-formed, the result appears indented in the result panel; otherwise, you see the parser error message. This checks well-formedness, not schema validity against XSD or DTD.

  1. Paste XML in the input panel.
  2. Check the status: Valid XML (well-formed) or Syntax error.
  3. If there is an error, find the tag mentioned in the message and correct opening tags, closing tags or special characters.
  4. Use Copy result to copy the indented XML.

Examples

Formatting XML from a single line

Input
<pedido id="42"><cliente>Ana</cliente><itens><item sku="A1" qtd="2"/></itens></pedido>
Indented result
<pedido id="42">
  <cliente>Ana</cliente>
  <itens>
    <item sku="A1" qtd="2"/>
  </itens>
</pedido>

Each child element adds a level of indentation. Empty self-closing elements, such as the item element, are preserved.

Common errors and fixes

ProblemCauseHow to fix it
Unclosed or incorrectly nested tag Elements must be closed in the reverse order of their opening tags. Close each tag at the same nesting level where you opened it.
More than one root element The document has two top-level elements. Wrap everything in a single root element.
Unescaped special character An unescaped & or < in text breaks the document. Use &amp; and &lt;, or a CDATA section.
Unquoted attribute Attribute values require quotes. Write id="42" instead of id=42.
Letter case XML distinguishes <Item> from <item>. Use exactly the same name in opening and closing tags.

What this tool does and does not do

Privacy and storage

Your input is processed in your browser and is not sent to Novemax. Your text is saved in your browser local storage (localStorage), so you can return to it later. On a shared computer, clear the editor before leaving. The site uses Google Analytics and Google AdSense according to your cookie preferences; these services do not receive the text you type in the editor.

Frequently asked questions

Is my XML sent to a server?

No. Your browser parses the XML. Your text is not sent to Novemax and is saved only in browser local storage.

What is the difference between well-formed and valid XML?

Well-formed means that the syntax is correct. Valid means that the document also conforms to a schema, such as XSD or DTD. This editor checks the first condition.

Can I check sitemap.xml?

You can check the syntax of the file. For sitemap protocol rules, including limits and fields, see the guide linked below.

Does it support an encoding declaration?

Yes. The declaration <?xml version="1.0" encoding="UTF-8"?> is accepted. When you paste text, the browser already treats it as Unicode.

Keep learning

Updated on November 4, 2026 · Tool maintained by Novemax. Found an issue or have a suggestion? Contact us.