Convert XML to JSON

Convert XML to JSON instantly in your browser. Preserve attributes, control array handling, and preview formatted JSON live with copy and export options.

Paste your input above or import a file below.
No file chosen
Supported file types: .xml, .txt, .log
Total characters: 0
Options
Include attributes
Compact output
Maximize output

How to Use:

  • Paste your XML or use Choose File to upload .xml, .txt, or .html files
  • Toggle Include attributes to preserve attributes as @attributes in the JSON output
  • Enable Always array for repeated tags to force arrays even for single items
  • Use Maximize output to enlarge the preview area for easier scrolling
  • Output is auto-formatted as readable JSON and updates live as you edit
  • Click Copy Output to copy the JSON
  • Click Export to File to save the result as a .json file
  • Click Clear All to reset everything

What Convert XML to JSON can do:

Convert XML to JSON turns structured XML into readable, usable JSON. It gives you full control over how repeated tags and attributes are handled, making it ideal for developers moving data between systems. Whether you’re integrating with an API, transforming feeds, or debugging XML, this tool offers instant, clean JSON you can copy, export, or use right away no installs, no uploads, just fast, flexible conversion.

Example:

Input XML:

<note priority="high">
<to>Tove</to>
<from>Jani</from>
</note>

Output JSON:

{
"note": {
"@attributes": {
"priority": "high"
},
"to": "Tove",
"from": "Jani"
}
}

Common Use Cases:

Convert XML to JSON is great for developers, testers, and analysts who need to transform XML into JSON for APIs, applications, or storage. It’s also perfect for converting XML config files into JSON equivalents or simplifying nested markup for front-end use.

Useful Tools & Suggestions:

If you’re about to convert, try Prettify XML first so the structure’s easier to follow. Then after the switch, use JSON Validator to make sure the output’s actually usable and clean.