quialo.

XML Formatter

Paste XML above to format it.

Paste messy or minified XML and get a clean, readable document with consistent indentation. The formatter walks each tag, indents one level for every open element, steps back out on each close, and keeps self closing tags inline. It also flags obviously broken markup such as mismatched or unclosed tags. Everything runs in your browser, so your XML never leaves your device.

How to use

  1. Paste your XML into the input box.
  2. Choose an indent size: 2 spaces, 4 spaces, or tabs.
  3. Read the formatted result in the output box, updated as you type.
  4. Click Copy to grab the formatted XML, or Reset to start over.

Examples

  • Input: <note><to>Quialo</to><from>Team</from></note>. Output: note on its own line, with to and from indented two spaces each, then the closing note tag.
  • Input: <config><server port="8080"/><debug>true</debug></config>. Output: the self closing server tag stays inline, debug sits on its own indented line.
  • Input: <a><b></a></b>. Output: an error reading Mismatched tags: expected </b> but found </a>.

FAQs

Does my XML get uploaded anywhere?
No. The formatting runs entirely in your browser using client-side JavaScript. Nothing is sent to a server.
What counts as broken XML here?
The tool catches the common structural problems: an unclosed angle bracket, a closing tag with no matching opening tag, mismatched tag names, and unterminated comments or CDATA blocks. It reports a clear message instead of mangling the output.
How are self closing tags handled?
Tags like <br /> or <item/> stay on a single line at the current indentation level. They do not change the depth of the lines that follow them.
Can I change the indentation width?
Yes. Use the Indent selector to switch between 2 spaces, 4 spaces, and tabs. The output updates immediately.
Why is some short text kept on the same line as its tags?
When an element holds only a small amount of text, the formatter keeps <tag>text</tag> on one line so the result stays compact and easy to scan. Longer text moves to its own indented line.
Is this a full XML schema validator?
No. It checks structure (tag nesting and pairing) and pretty prints. It does not validate against a DTD or XSD or check attribute rules.

Related tools