Text and dataRuns in your browser

XML Formatter and Validator

Check matching tags, quoted attributes, entities, and a single root element, then format the XML.

  • Well-formedness
  • DTD/ENTITY disabled
  • Mixed content preserved
Online tool

Try the tool

Add your data, choose the settings, and get the result.

XML document

Result

Run the XML validation.

Processing in your browser

Text and selected files are processed in the current browser and are not sent to a server to produce the result.

Reviewed: 2026-07-17
01

How to use it

  1. 1

    Paste XML and choose the indentation size.

  2. 2

    Run validation and formatting.

  3. 3

    Fix structural errors or copy the result.

02

What the tool can do

  • Start/end/self-closing tags, quoted attributes, and duplicate-attribute detection.
  • XML comments, CDATA, and processing instructions.
  • Predefined and numeric entity references without custom entity expansion.
  • Formatting of structural content while mixed content remains compact.
03

Common use cases

  • Checking an API payload, feed, or configuration XML.
  • Finding mismatched tags and duplicate attributes.
  • Preparing a readable copy of a small XML document.
04

How it works inside

Input is limited to 500,000 characters, 10,000 nodes, and depth 64.

The formatter does not inject indentation inside mixed content so significant text is not changed.

05

Questions and answers

What does a successful XML check mean?

The tool checked supported syntax and document structure rules, such as tag closure. It does not confirm compliance with your XSD schema or a receiving service's requirements. Check those separately.

Why are documents with DTD or ENTITY declarations rejected?

Those declarations are unsupported and rejected before parsing. No external data is fetched through them. If your format requires them, use a dedicated XML tool with the appropriate settings.