XML formatter and validator

    Pretty-print, validate or minify XML with error positions.

    Your text stays on this device

    About the XML Formatter tool

    This XML formatter pretty-prints XML with consistent indentation, checks that it is well-formed and can minify it to one line. If a tag is unclosed or mismatched, it shows the line and column and the tag it expected, which helps with a sitemap.xml that will not validate or a Tally XML export that will not import. It opens .xml, .svg, .rss, .atom, .xsd and .xsl files up to 20 MB. It checks well-formedness only; it does not validate against an XSD schema.

    At a glance

    Output
    2 spaces, 4 spaces, tabs or minified; saved as formatted.xml
    Checks
    Well-formedness (one root, closed tags, quoted attributes); no XSD schema check
    Files
    .xml, .svg, .rss, .atom, .xsd, .xsl up to 20 MB
    Kept
    Text, attributes, CDATA and comments (comments can be removed)
    Price
    Free, no sign-up
    Works in
    Your browser, on phone or computer. Works offline after the first visit.
    Privacy
    What you type never leaves your device.

    How to format XML

    1. Paste your XML or open an .xml file.
    2. Pick 2 spaces, 4 spaces, tabs or Minify, and whether to remove comments.
    3. Copy or download the result. Errors point to the line and column.

    Private

    Your text stays in your browser and is never sent to a server.

    Instant

    Results update as you type, with nothing to install.

    Free

    No sign-up, no limits and no ads inside your writing space.

    XML Formatter: frequently asked questions

    How do I find an error in a large XML file?

    Paste it here. The tool names the line and column of the first problem, for example "expected </item> (opened at line 12) but found </items>", and "Show line" selects it in the input.

    What does "well-formed" mean?

    Well-formed XML has exactly one root element, every tag closed in the right order, quoted attribute values and escaped special characters such as &amp; and &lt;. This tool checks those rules; it does not validate against an XSD schema.

    Does formatting change my data?

    No. Only whitespace between tags changes. Text inside elements, attributes, CDATA sections and comments are kept (unless you choose to remove comments).

    Is my text sent anywhere?

    No. Everything runs in your browser and your text never leaves your device. Nothing is stored on any server.