XML Editor and Formatter

Write or open an XML document, validate it with precise error positions, then format or minify it — all in your browser. No uploads, no external entities, no network requests.

Indentation uses two spaces. Formatting and minifying replace the editor content only after the document has parsed successfully.

How to use

  1. Paste XML into the editor, or press Open .xml file to load a local file (up to 10 MiB).
  2. Press Validate to check well-formedness. Errors are shown with line and column, the parser's reason, and the offending line.
  3. Press Format for readable indentation, or Minify to strip insignificant whitespace between elements.
  4. Copy the result or Download .xml to save it.

What formatting does — and does not — change

Security and limits

Frequently asked questions

What does this XML editor do?

It is a lightweight editor for checking and tidying XML: validate well-formedness, format with two-space indentation, minify, and copy or download the result. It works entirely in your browser.

How are errors reported?

Validation reports the first problem with its line and column number, the parser's explanation (for example, a mismatched closing tag or an unescaped &), and a copy of the offending line, so you can jump straight to the fix. The editor content is never overwritten while it is invalid.

Does formatting change my document's meaning?

No. Only whitespace between elements is adjusted. Text nodes, attribute values, comments, and CDATA sections are kept as they are, and elements with mixed text and markup are left untouched. If a document cannot be formatted safely, the tool says so and keeps the original.

Why was my document with a DOCTYPE or ENTITY rejected?

Entity declarations and external DTD references are the classic way XML processors get tricked into reading local files or contacting remote servers (XXE). This tool refuses such input up front instead of trying to interpret it. A plain <!DOCTYPE name> without declarations is accepted and preserved.

Can it validate against an XSD or run XPath?

Not in this version. The editor checks well-formedness only. Schema validation, XPath, and XML-to-JSON conversion are out of scope for now.

Which encodings are supported?

Text pasted into the editor is already Unicode. Files opened with the file picker are read as UTF-8; a file saved in another encoding may show garbled characters and should be converted to UTF-8 first.

Is my XML uploaded anywhere?

No. Parsing, validation, formatting, and minifying happen locally in your browser. This page loads no third-party scripts and makes no network requests with your content.

Related tools