XML 工具
XML to JSON
Try it
Convert XML to JSON (fast-xml-parser).
Loading…
How to use this tool, examples, and related tips.
Paste your XML document into the input field.
The tool parses the element tree and maps it to an equivalent JSON structure — elements become keys, text content becomes values, and attributes are included as properties.
Copy the JSON output and use it directly in your application or pipeline.
XML to JSON conversion transforms a hierarchical XML document into a JSON object that represents the same data. XML elements become JSON keys, text content becomes string values, nested elements become nested objects, and repeated sibling elements become arrays. Attributes are typically mapped to properties on the corresponding object. The conversion makes XML data from legacy systems, SOAP APIs, or RSS feeds consumable by modern JavaScript applications, REST APIs, and data pipelines without writing a custom parser.
Consuming SOAP or legacy XML APIs — Convert XML responses to JSON so they can be handled by modern JavaScript or Python code.
Processing RSS and Atom feeds — Convert feed XML to JSON for easier iteration and rendering in web applications.
Data migration — Transform XML data exports into JSON for import into modern databases or APIs.
Prototyping — Quickly convert a sample XML response to JSON to understand its structure before writing parsing code.
Answers about this tool and how your data is handled.
Attributes are typically mapped to properties on the corresponding JSON object, often prefixed with @ or _ to distinguish them from child elements. Check the output to confirm the convention used.
Repeated sibling elements with the same tag name are converted to a JSON array.
Namespace prefixes are preserved in key names (e.g., ns:element becomes a key like "ns:element"). Namespace declarations may be included as properties.
No. Conversion runs entirely in your browser. Nothing is uploaded.
Yes — use the JSON to XML tool to reverse the transformation.
优先同类别,再显示其他实用工具。
XML 工具
Convert XML to JSON (fast-xml-parser).