All tools

XML formatter

Minified XML from log dumps and API responses is hard to read. Pretty-print with consistent indentation to spot mismatched tags, namespace issues, and rogue CDATA sections. Formatting runs locally — useful for enterprise configs containing internal hostnames.
Input
This tool is available in a web browser.

How to format XML

1. Paste XML or upload .xml file.
2. Click format / beautify.
3. Review indented tree structure.
4. Copy formatted XML or fix errors shown by parser.

XML formatting examples

Maven pom.xml

One-line dependency block expanded for readable diff before commit.

SOAP fault debug

Indent nested faultstring and detail nodes to find application error code.

RSS feed check

Format channel item XML to verify pubDate and enclosure URLs.

When to format XML

When reviewing config before deploy.
When comparing two XML snapshots visually.
When teaching XML structure to juniors.

When formatting misleads

When whitespace inside elements is significant (xml:space="preserve").
When signing XML digests — formatting changes bytes.
When file is HTML not XML — use HTML-specific tools.

XML vs JSON mindset

XML carries attributes, namespaces, and mixed content. Converting to JSON loses nuance — format XML in place when working with legacy SOAP or SAML.

Security

Billion laughs and external entity attacks target XML parsers — browser formatters should disable external entities; still avoid pasting untrusted huge XML.

Pipeline with YAML

Many DevOps files started as XML (Maven, Ant) — format before converting patterns to YAML mentally or with yamlToJson for greenfield stacks.

Frequently asked questions

Does formatter fix invalid XML?

It shows parse errors — you must close tags and escape & < manually.

Attributes order?

Pretty-print may reorder attributes visually but values unchanged.

Large XML files?

Browser may choke on multi-100MB — use xmllint CLI for huge files.

Namespaces?

Valid namespaces preserved — prefix bindings must be correct in source.

Uploaded?

No.

Compare two XML files?

Format both then use text diff tool.