~/tools / XML Formatter
XML Formatter
Format XML with indentation, or minify it to one line. Parsed with the browser's built-in DOMParser, so invalid XML is caught as an error.
Useful for making sense of a SOAP API response or a squashed config file (like pom.xml) — format it to see the structure clearly. Syntax errors are caught too.
# Use Cases
- Formatting a SOAP or legacy web service XML response to understand its structure
- Cleaning up a minified config file like pom.xml or an Android layout XML
- Tracking down a missing closing tag or other XML syntax error
# Usage
- Paste the XML you want to format or minify into the text area.
- Click "Format" for an indented, readable layout, or "Minify" to collapse it to one line.
- An error message appears for issues like unclosed tags.
# FAQ
- Does it support DTDs and namespaces?
- It formats basic XML structure (elements, attributes, text). Complex DTD declarations or namespace-heavy documents may not render exactly as intended.
- What happens with invalid XML?
- The error message reported by DOMParser is shown. Unclosed tags and unquoted attribute values are the most common causes.