or drop a file here, or paste code below
Type, paste or open XML to check it.

Document tree

The tree appears when you open or type XML.

Files never leave your browserHow?

XML formatter, validator and XPath tester

Open, edit and save XML files in your browser. Pretty-print or minify, check that the document is well-formed, browse the tree and run XPath queries. Nothing is uploaded.

How it works

  1. Open or paste XML

    Drop an .xml or .xml.gz file, use Open file, paste the markup or load the sample. The encoding is taken from the BOM or the XML declaration.

  2. Edit and check

    Edit with highlighting and auto-closing tags. Every change is checked for well-formedness, and an error shows its line and column.

  3. Format, query and save

    Use the XML formatter to pretty-print or minify, click nodes in the tree, run an XPath query, then save the file as UTF-8.

Features

  • XML formatter

    Pretty-print with 2 spaces, 4 spaces or tabs, or minify. Text, CDATA sections, comments, processing instructions and xml:space="preserve" content are kept exactly as written.

  • Well-formedness check

    Mismatched or unclosed tags, bad attributes, undeclared entities and namespace prefixes are reported with line, column and a Go to error button.

  • Document tree

    Click a node in the side panel to select it in the editor.

  • XPath search

    Run XPath 1.0 expressions such as //item[@id="1"] or count(//book). Matches are listed and highlighted.

  • Safe with untrusted files

    External entities are never loaded and entity expansion is limited, so XXE and "billion laughs" files cannot read data or hang the page.

  • Large files

    Big documents and .gz archives are processed in a background worker.

Limits & privacy

Files can be up to 100 MB, also after decompressing an .xml.gz file. Syntax highlighting, folding and tag auto-closing work up to 5 MB. The document tree and XPath are available up to 10 MB; larger documents are shown read-only, while the well-formedness check, the XML formatter and Save still work.

Files are saved as UTF-8; if the XML declaration names another encoding it is changed to UTF-8. DTD validation, XSD schemas and XSLT are not supported. External DTDs and entities are never fetched. See the privacy page.

FAQ

How do I edit an XML file online?

Open the .xml file with Open file or drag it onto the editor, make your changes and press Save .xml. The file stays on your device.

Is this online XML editor free?

Yes, free and without sign-up.

Can I edit an XML file on Android?

Yes. Open this page in your Android browser, tap Open file, edit the code and save.

How do I edit XML in Microsoft Edge?

Edge shows XML read-only. Open the file on this page in Edge instead, and you can edit, format and save it.

How do I format or pretty-print XML?

Press Format and choose the indentation. Minify removes the whitespace between tags. Text content is never changed.

How do I check if my XML is valid?

The editor checks well-formedness as you type and shows the position of the first error. Validation against an XSD schema is not available yet.

Can I edit NF-e or CFDI invoice XML here?

You can open and edit any XML file, but this tool knows nothing about tax rules or digital signatures; editing a signed invoice invalidates its signature.

Related tools