Make XML readable before you lose your mind
XML is verbose by nature. Tags have opening and closing versions, attributes pile up, and nesting goes deep. Without indentation, a moderately complex XML document is an impenetrable wall of angle brackets.
Paste the raw or minified XML, pick 2-space or 4-space indentation, and get properly nested, readable output. CDATA sections stay intact, comments are preserved, processing instructions (<?xml ... ?>) stay where they belong, and self-closing tags are handled correctly.
Where XML still lives
JSON won the data interchange war, but XML is deeply entrenched in specific ecosystems and it’s not going anywhere.
Maven and Gradle: pom.xml files with hundreds of dependencies and plugin configurations. Formatting makes them manageable.
Android: layout XML, manifest files, resource definitions. Android development is basically XML development.
SOAP APIs: enterprise web services still run on SOAP, and debugging means reading XML envelopes.
RSS and Atom feeds: if you’re building or debugging a feed reader, you’re working with XML.
Office formats: OOXML (docx, xlsx, pptx) and ODF are XML under the hood.
Spring, Hibernate, web.xml: the Java ecosystem has a deep XML tradition.
Formatting conventions
2 spaces for web-oriented XML. 4 spaces for Java and enterprise XML. Match whatever your team uses.
CDATA sections (<![CDATA[...]]>) are preserved exactly as-is, the formatter won’t touch the content inside them. Same for comments. Processing instructions stay at the top of the document.
The formatter handles the visual layout but doesn’t validate against a DTD or schema. For HTML formatting specifically, the HTML Formatter is also available.
FAQ
CDATA and comments?
Preserved intact. Content inside CDATA sections isn’t reformatted. Comments are kept in place with proper indentation.
Does it validate XML?
No, formatting only. No DTD checking, schema validation, or structural analysis.
Large files?
In-browser processing handles large documents. Very large files (several megabytes) might take a moment depending on your device.
2 or 4 spaces?
2 spaces is common for web XML. 4 spaces for Java ecosystem XML. Match your project.
Client-side?
Yes, your XML stays in your browser.