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.

*The maximum size limit for file upload is 2 megabytes. All files bigger than 1 megabyte will be formatted to a new window for performance reason and to prevent your browser from being unresponsive.

Option 1: Copy-paste your XML string here
Option 2: Or upload 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
Indentation level:
Force output to new window: