XML to JSON Converter

This online tool allows you to convert an XML file into a JSON file. This process is not 100% accurate in that XML uses different item types that do not have an equivalent JSON representation.

The following rules will be applied during the conversion process:

  • Attributes will be treated as regular JSON properties
  • Attributes MAY be prefixed with a string to differentiate them from regular XML elements
  • Sequences of two or more similar elements will be converted to a JSON array
  • Namespaces are completely omitted from the resulting property names
  • Terminal #text item types will be converted into a JSON property with the name #text. This can be changed in the options.

*Files bigger than 1 meg will not be formatted to a tree structure for performance reason. They will instead be formatted to a plain text format.

Option 1: Copy-paste your XML string here
Option 2: Or type in the URL to your XML file
Prefix attributes with:
XML attributes will be transformed into regular JSON properties and this prefix will be added to the property name to help differentiate a regular node from an attribute. Leave blank if you do not want a prefix.
#text property name:
The name given to the JSON property that reflects a terminal XML #text item type.
JSON output indentation level:
Force output to new window: