XML to JSON
XML to JSON
Convert XML payloads into JSON for API and integration workflows.
Output size
0chars
Nested XML tags map to JSON objects/arrays. Attributes are included, scalar coercion is enabled, and root wrapper is kept.
File input
Choose a file
Click, drop, or paste from clipboard.
More actions
Conversion policy: repeated sibling tags become arrays; mixed-content nodes keep text under the selected text key.
Copy report details includes output + run metadata.
Your input is processed locally in your browser whenever possible. We do not store your data.
Flow
- Remove XML declaration and comments from source.
- Parse tags into a nested node tree.
- Convert nodes to JSON objects and arrays based on repeated tags and selected conversion policies.
Example
Worked example: user xml payload
- 1 Input XML with user id, name, and item list.
- 2 Parser builds nested tree from tags.
- 3 Tree is converted into formatted JSON output.
XML payload is represented as structured JSON.
How
- Paste XML text into the input panel.
- Choose conversion options for attributes, scalar coercion, and root wrapper.
- Run conversion to generate JSON output.
- Copy JSON for formatting, diffing, or downstream transforms.
Cases
- Inspect SOAP-like responses in JSON form.
- Prepare XML payloads for frontend debugging.
- Convert sample XML docs for quick prototyping.
Avoid
- Disabling root wrapper then expecting a top-level element key in output.
- Using malformed XML with mismatched closing tags.
- Assuming scalar coercion is off when numbers/booleans are auto-converted.
FAQ
Are XML attributes preserved?
Yes when attribute mode is enabled. Attributes are emitted with a configurable prefix.
Can repeated tags become arrays?
Yes, repeated sibling tags are mapped to arrays in output JSON.
Does conversion happen in the browser?
Yes, XML parsing and JSON generation run locally.
Switch
Switch12
No match.