Parsed, not guessed
The formatter works on the real XML tree, so structure and attribute values are preserved.
Start typing to search 227 tools.
Format and pretty-print XML online with two-space indentation. Invalid XML is rejected with the line and column of the first error.
The XML formatter turns compact or messy XML into indented, readable markup. Paste an API response, a SOAP message, an RSS feed, an SVG, a sitemap or a configuration file, and the tool parses it and prints it with each nested element on its own line, indented by two spaces.
Because the input is parsed first, the formatter doubles as a quick well-formedness check: if the XML is broken, you get an error with the line and column instead of a half-formatted result. To check a document without changing it, use the XML Validator.
Focused controls, predictable output, and a workflow designed around this exact transformation.
The formatter works on the real XML tree, so structure and attribute values are preserved.
Broken XML is rejected with the position of the first problem.
Network access for external entities is disabled while parsing.
Consistent two-space indentation makes diffs and reviews easier.
Practical details about input, output, privacy, limits, and the best way to use this tool.
Formatting changes only whitespace between elements. Validation only reports whether the document is well-formed. The formatter does both in one step, because it must parse the XML first. For a pure check, use the XML Validator.
The output starts at the root element. The <?xml ... ?> declaration, a DOCTYPE and comments placed before or after the root element are not included. Comments inside the root element are kept. Add the declaration back if your system requires it.
Not for data-oriented XML: whitespace-only text between elements is dropped and replaced by indentation. If your format treats such whitespace as significant, compare the result with the original before using it.
Browsers are often forgiving with HTML-like markup. This tool requires well-formed XML: one root element, matching tags, quoted attributes and escaped special characters such as &.
Large documents work, but they depend on your browser and the server limits. For multi-megabyte files, a local tool such as xmllint is more practical.
No. Network access is disabled during parsing, so external references are not fetched.
Use the XML Minifier to remove the indentation.
Understand XML syntax, elements, attributes, namespaces, validation, formatting, parsing, security, and common errors.
XML ignores most whitespace between elements, so the same document can be written on one line or spread over hundreds. The formatter parses the text into a tree and prints it again with one element per line and two spaces per level. That makes the nesting visible and lets you scan a response, compare two versions or spot a missing element at a glance.
& for an ampersand and < for a less-than sign in text.soap:Envelope without an xmlns:soap declaration.The tool formats the document tree and does not validate it against an XSD or DTD. The declaration, DOCTYPE and comments outside the root are not part of the output. Always test the formatted result in the application that will consume it.
Check a document with the XML Validator, shrink it with the XML Minifier, convert it with XML to JSON, or format JSON with the JSON Formatter.
The syntax rules are defined in the W3C Extensible Markup Language (XML) 1.0 specification.