Common XML workflows
XML separates attributes from elements, keeps mixed text and binds prefixes to namespaces. A formatter checks well-formedness, not a schema. A JSON conversion has to choose how attributes, repeated elements and text nodes are represented, so read the mapping before relying on the result.
Debug a SOAP or RSS response
Format the document to find the element you need, then test an XPath expression against it. Use local-name() to match elements in a default namespace.
- XML Formatter — Pretty-print, minify and check XML.
- XPath Tester — Evaluate XPath expressions against XML.
- XML to JSON — Convert XML documents to JSON.
Review a configuration change
Compare two XML files structurally to see changed elements and attributes without noise from attribute order or prefix spelling. Use a text diff when comments and whitespace matter.
- XML Diff — Compare XML by structure, namespaces and values.
- XML Formatter — Pretty-print, minify and check XML.
- Diff Checker — Compare two texts and highlight the differences.
Move data between XML and JSON
Convert XML to JSON for a JavaScript client, or generate XML from JSON for a legacy integration. Check how attributes and single-item arrays come out before automating the conversion.
- XML to JSON — Convert XML documents to JSON.
- JSON to XML — Convert JSON to XML with attributes and arrays.
- JSON Formatter — Pretty-print, validate and repair JSON.
Choose a structural comparison for XML
XML Diff resolves namespace prefixes and compares attributes without depending on their order. Use a text diff when comments, whitespace or the exact spelling of the source matter.
Well-formed is not the same as valid
A formatter can prove that tags are balanced and attributes are quoted. It cannot prove that a document follows an XSD or DTD; validate against the schema your consumer uses.
Frequently asked questions
Why does my XPath expression return nothing?
The most common cause is a default namespace. In XPath 1.0, elements declared with xmlns="…" and no prefix do not match a bare name; use //*[local-name()="book"] instead.
Can XML to JSON be reversed without loss?
Not always. JSON has no attributes, comments or processing instructions, so a converter maps them to conventions. Converting back may not reproduce the original document exactly.
Tools process your input on this device. Read the privacy policy, or save the tool library for offline use.