Menu
PDF Tools
Image Tools
Converters & Utilities
Seller & Print Tools
Accounting & Business
Calculators
Text & Writing Tools
Developer & Web Tools
Creator & Social Tools
Browser Utilities & Games
Document & Design Makers
Text & Developer Tools
Exam & Form Tools

XML Formatter

XML Formatter checks that XML is well formed, then indents it with two or four spaces or a tab, or removes the extra white space. It runs in your browser.

How to use XML Formatter online

  1. Paste the XML. Paste your XML into the box.
  2. Read the check. If the XML is not well formed, the message names the problem and its place.
  3. Format or minify. Choose the indent and press Format, or press Minify for the smallest text.
  4. Copy. Copy the result.

Why use this free XML Formatter

  • Well-formedness check
  • Line and column of the error
  • Two spaces, four spaces or tab
  • Minify
  • Comments and CDATA kept
  • Nothing sent, nothing stored

Readable XML

XML from a program often arrives as one long line, which is hard to read. This tool puts every element on its own line and indents the children, so the structure is visible. It can also do the opposite and remove the extra white space to make the text smaller.

What well formed means

The tool checks the basic rules of XML. Every opening tag needs a matching closing tag, in the right order. There must be one root element. Attribute values must be in quotes, and an attribute may not appear twice on a tag. A bare ampersand must be written as &. When a rule is broken, the message names it and gives the line and column.

What it does not check

Well formed is not the same as valid. A valid document also follows a schema or a DTD that lists which elements are allowed. This tool does not read those, so use the validator that comes with your system when you need to check against one.

What is kept and what changes

The XML declaration, comments, CDATA sections and processing instructions are written back as they were. Text inside an element is trimmed, and white space between tags is removed. For data files that is harmless. In running text with markup inside, such as a paragraph with bold words, the spaces around the markup can matter, so look at the result before you use it.

Repeating the format

Formatting the output a second time gives the same text, so you can run it again safely. Your XML is read in this tab and is not sent anywhere.

XML Formatter: frequently asked questions

Does it validate against a schema?
No. It checks that the XML is well formed, not that it follows a schema or a DTD.
Why does it say a tag does not match?
A closing tag must have the same name as the tag that is open at that point.
Are comments kept?
Yes. Comments, CDATA sections and the XML declaration are kept as written.
Why is an ampersand an error?
In XML an ampersand starts an entity, so a lone one must be written as &.
Can I choose tabs?
Yes. Choose two spaces, four spaces or a tab.
Is my XML uploaded?
No. The check and the formatting happen in your browser, and the text is forgotten when you close the page.

Related searches for XML Formatter

  • XML Formatter online
  • free XML Formatter
  • XML Formatter online free
  • XML Formatter for mobile
  • XML Formatter without sign up
  • XML Formatter – Text & Developer Tools

XML Formatter is a free online tool on MAITBOX, in the Text & Developer Tools group. It runs in your browser, so what you type is not sent to a server. It works on Android and iPhone, and on Windows, Mac and Linux, with no download and no account.

More tools in Text & Developer Tools →

Search tools