Conversion Tools

XML & JSON Converter

Convert simple XML documents to JSON and JSON objects to XML.

Your input is processed in this browser and is not sent to our server.

How to Use XML ↔ JSON

  1. Select XML to JSON or JSON to XML.
  2. Paste a well-formed document or a JSON object with one root property.
  3. Select Convert data and review the result.

Example

Input

<item id="7">Book</item>

Result

{"item":{"@id":"7","#text":"Book"}}

Common Errors & Troubleshooting

  • JSON to XML requires exactly one top-level property with a valid XML name.
  • For XML to JSON, repeated child elements are represented as arrays.

Frequently Asked Questions

Are XML attributes retained?

Yes. XML attributes are represented as JSON properties prefixed with @; element text with attributes or children uses #text.

Does conversion preserve every XML feature?

This converter handles elements, attributes, and text; it is not a round-trip editor for namespaces, comments, processing instructions, or schemas.