Skip to content
Cifrivo
Developer

XML formatter and validator

Format, minify and validate XML locally, retaining attributes, text and structure while reporting parser errors.

Processed locallyYour files never leave your device.

Everything is processed locally in your browser.

How it works

  1. Paste XML or open a .xml file.
  2. Choose Format, Minify or Validate.
  3. Correct any parser error shown by the browser.
  4. Copy or download the resulting XML.

Practical example

<catalog><book id="1"><title>Tools</title></book></catalog> becomes an indented hierarchy while the id attribute and text remain unchanged.

Formula and explanation

Formatting inserts line breaks and indentation between tags so element nesting is visible. Minifying removes whitespace that only separates tags; it does not intentionally rewrite text inside elements.

The XML parser verifies matching tags, quoted attributes and a single document element. Cifrivo rejects DOCTYPE declarations as a safety measure because developer utilities rarely need external entities.

Unlike HTML, XML names and casing are significant. A <Book> opening tag cannot close with </book>. Processing uses DOMParser in this browser and no document content is transmitted.

Frequently asked questions

Does formatting XML change element text?

It removes whitespace found only between tags, but preserves the text inside elements. Whitespace-sensitive XML should still be reviewed.

Why are DOCTYPE declarations rejected?

They can introduce entity and external-resource behavior that is unnecessary for this local formatter.

Is XML case-sensitive?

Yes. Element and attribute names must use consistent casing.