Skip to content

Install ALink Tools

Free browser tools for images, PDFs, media, text and web checks. Most tools process files locally on your device.

  1. Tap the Share button in the Safari toolbar.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add. ALink Tools then opens from your Home Screen like an app.

XML Formatter

Indent XML so you can read it, or minify it to a single block. Comments, CDATA and the declaration are kept. The document is not validated against a DTD or schema and is not executed.

Runs in your browserPretty-print or minifyRuns in your browser
1

XML

Limits

  • The input is limited to 2 MB of UTF-8 text (8 MB if you load a file). Larger files can run out of memory in a phone browser tab.
  • Not a schema or DTD validator. External entities are not loaded (and should not be).
  • HTML-specific quirks (unclosed <li>, implicit <tbody>, void tags without a slash) are treated as errors if they are not well-formed XML.
  • Attribute order is kept. Pretty-printing can still change insignificant whitespace in mixed content.
  • Documents much larger than the input limit, or with extremely deep nesting, may fail in a small tab.
2

Formatted XML

How to use XML Formatter

  1. Paste or load XMLDrop a .xml file or paste the document.
  2. Choose indent or minifySet the indent size, or switch to minify to remove ignorable whitespace.
  3. Copy or downloadCopy the result or download a .xml file.

What is rewritten

The formatter tokenizes tags, comments, CDATA, processing instructions and text, then reprints them with consistent indent (or with ignorable whitespace removed). A start tag and its text-only content are kept on one line. Self-closing tags are normalized to a space before the slash.

It is not an HTML parser: it will not fix unquoted attributes the way a browser would, and it will not run scripts or load external entities. DTD and XSD validation are not performed. Mismatched or unclosed tags are reported instead of being guessed.

Frequently asked questions

Is my text or file uploaded?

No. Everything runs in your browser tab with JavaScript. Nothing you type, paste or drop is sent to a server, logged or stored by ALink Tools.

Will this validate my XML?

It only checks that tags nest and close correctly. It will not apply an XSD, a DTD or a Schematron rule, and it will not fetch a SYSTEM identifier.

Can I format HTML here?

Only if the HTML is also well-formed XML (for example XHTML). Use HTML Formatter for typical HTML5.

Are comments and CDATA kept?

Yes. They are not discarded when you pretty-print or minify.

Related tools

All tools