consolelog.tools

XML Validator

Validate XML well-formedness live — a precise line:column code-frame on the offending tag, plus a formatted copy when valid.

About this ToolHow it works, benefits & use cases

The XML Validator checks whether your XML is well-formed — every tag properly opened, closed, and nested — and shows you where it breaks if it is not. Paste XML and a lightweight parser tokenizes the document live, verifying that opening and closing tags match and that nothing is left dangling. Valid input gets a green "Valid XML" banner with an element count, and the tool also renders a cleanly formatted copy of your markup that you can copy or download as a .xml file. Invalid input produces a red error with the message, the line and column, and a code-frame snippet whose caret points at the offending tag — for example a mismatched or unclosed element. It handles comments, CDATA, processing instructions, and the XML declaration as it parses. This is a well-formedness check (not DTD or schema validation), it runs entirely in your browser, and it is free.

How to Use

  1. 1Paste your XML into the input panel, or click "Load example" to load a sample catalog document.
  2. 2Validation runs live as you type; click "Validate XML" to confirm.
  3. 3On success, read the "Valid XML" banner showing it is well-formed plus the element count.
  4. 4On failure, use the code-frame error with its line:column and caret to locate the mismatched or unclosed tag.
  5. 5When valid, copy or download the auto-formatted XML from the output panel as a .xml file.

Key Benefits

  • Verifies well-formedness: matched, properly nested, fully closed tags
  • Precise line:column code-frame and caret on the offending tag
  • Element count reported for valid documents
  • Renders a formatted copy of valid XML you can copy or download
  • Recognizes comments, CDATA, processing instructions, and the declaration
  • Live validation updates as you type
  • Runs entirely in the browser — XML is never uploaded

Common Use Cases

  • Confirming an RSS feed, sitemap, or SVG file is well-formed before publishing
  • Tracking down a mismatched or unclosed tag in a broken document
  • Validating a hand-edited config or SOAP payload during integration work
  • Getting a formatted copy of XML in the same step as validating it
  • Checking that generated XML output is structurally sound

0 characters · live

Paste XML above to validate it live.

Was this tool helpful?

Share Your Experience

Help others discover this tool!

Related tools