Home / Web & Developer / XML Formatter
📰 XML Formatter
XML Formatter – get instant, free results right on your device.
Validation is done with the browser's XML parser; DTD and schema (XSD) validation is not performed. Not an official institution.
Last updated: November 2026 · Parameter year: 2026 · Methods and sources: Methodology · Editorial policy
What is XML Formatter?
XML is a format that describes data with tags and is still widely used in configuration files, web services, sitemaps, and RSS feeds. XML that arrives on a single line or has broken indentation is hard to read; also, a single unclosed tag makes the whole document invalid. The formatter provides both readability and syntax validation.
When you paste text and use the “Format and validate” option, the tool reads the XML with the browser's parser; if it is valid, it indents nested tags with two spaces and shows “Valid XML ✓” at the top. If it is invalid, it shows an error message. The “Minify” option removes the whitespace between tags. Example: <a><b>1</b></a> becomes indented.
Validation is only a well-formedness check; DTD and XSD schema validation is not performed. The data you enter is not sent to a server; it is processed in the browser. To convert XML to JSON, you can use the XML to JSON Converter tool.
How to use
Fill in these fields: Operation, XML. Then press the button; the result appears on the same page and your data never leaves your device.
Formula
<a><b>1</b></a> → indented XML
Example
<a><b>1</b></a> → indented XML
Worked examples and tips
Example 1: You run the text <sepet><urun kod="A1"><ad>Kalem</ad><adet>3</adet></urun></sepet> with Format and validate. The status field shows Valid XML; in the result, the sepet, urun (kod="A1"), ad, and adet tags come one under another with two-space indentation. The ad and adet values stay on a single line each.
Example 2: To minify a file of the same kind, choose Minify. The structure <a>, <b>1</b>, <c>2</c>, spread across lines and indentation, becomes <a><b>1</b><c>2</c></a>. The status is again reported as Valid XML, meaning the minification did not change the meaning.
Example 3: If you enter a faulty input, <a><b>1</a></b>, the tool returns an ERROR and reports that the opening and closing tags do not match at line 1, column 12. With this information you find the exact location of the problem: the tags were closed crosswise, and b should have been closed first.
Tips and common mistakes: XML must have a single root element; if you write two sibling roots, the document is considered invalid. Attribute values must always be in quotes, and the & character must be written as &. It is case-sensitive; <Ad> and </ad> do not match. The column number in the error message usually points to where the problem ends, so look for the cause a little earlier.
When is it used? When reading service responses, validating configuration files, and minifying inline XML data.
Frequently asked questions
XML Formatter – how to use it?
Fill in the fields and press the button; the result appears instantly. Example: <a><b>1</b></a> → indented XML
XML Formatter – is it free, and is my data stored?
Yes, it is free and requires no sign-up. Because processing happens in your browser, the information you enter is not sent to a server.
Related guide
- What Is XML? The Difference Between XML and JSON, and How to Convert – What is XML, and what are its syntax rules? Differences between XML and JSON, how to choose between them, and examples of converting XML to JSON.