XML Tools

Format, validate, and parse XML documents with namespace support.

XML is the format everyone converts away from, which is a little unfair — it's more precise than JSON in ways that matter for the documents that still use it: SOAP APIs, RSS/Atom feeds, Office and OOXML file internals, and a long tail of enterprise systems that predate JSON's dominance. Attributes vs. child elements, namespaces, CDATA sections, and mixed content (text and elements interleaved) are all things XML can express cleanly that JSON has no native representation for at all.

Formatter pretty-prints with full namespace, CDATA, and comment support, so declarations like xmlns:soap="..." and embedded <![CDATA[...]]> blocks come through structurally intact rather than mangled. Validator checks well-formedness — balanced tags, valid character encoding, proper nesting — and reports the line and column of the first structural break; note that well-formed is not the same claim as valid against a DTD or XSD, which this tool doesn't attempt, since schema validation requires resolving and parsing an external schema document this tool never fetches. Parser exposes the parsed tree directly, which is the fastest way to answer "does this document actually have the element I expect" without scrolling through a large payload by eye.

The parsing layer here is the browser's native DOMParser, which means it's exactly as strict as what a browser would do with the same document — a genuine advantage for catching bugs before they reach production, but it also means documents relying on non-standard entity definitions or a DTD-driven default-attribute mechanism won't get those defaults filled in, since DTD processing is out of scope. When you need to move data between XML and JSON, the attribute-vs-element decision is inherently lossy in one direction (attributes have no JSON equivalent, so they get folded into a convention like an @-prefixed key) — see JSON to XML and XML to JSON in Converters for exactly how that mapping is handled, and don't expect a round trip through both to reproduce byte-identical XML.