Convert XML format into JSON format

Please log in or register to do it.

This tool converts XML format into JSON format. It provides flexible options so you can perform a standard conversion, pretty-print the resulting JSON, exclude XML attributes, or convert only specified XML elements. Simply enter your XML data, choose your desired conversion option, and click "Convert XML to JSON". This robust tool follows our ALFA template structure exactly.

Conversion Options:


Converts the entire XML into JSON using default settings (attributes included, minified JSON).

Converts the XML into JSON and formats the output with indentation for improved readability.

Converts the XML into JSON while omitting all XML attributes.

Converts only the XML elements whose tag names match those you specify (comma‑separated). All other elements are ignored.

Examples:

Standard Conversion

Converts the entire XML into JSON using default settings.

Before:
<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>
After:
{"to":"Tove","from":"Jani","heading":"Reminder","body":"Don't forget me this weekend!"}

Pretty Print JSON

Converts XML to JSON and formats the output with indentation.

Before:
<person>
  <name>John Doe</name>
  <age>30</age>
</person>
After:
{
  "name": "John Doe",
  "age": "30"
}

Exclude XML Attributes

Converts XML to JSON while omitting XML attributes.

Before:
<book id="123" genre="fiction">
  <title>The Great Gatsby</title>
  <author>F. Scott Fitzgerald</author>
</book>
After:
{"title":"The Great Gatsby","author":"F. Scott Fitzgerald"}

Convert Only Specified Elements

Converts only the XML elements with tag names matching the specified values (e.g., "book" and "author").

Before:
<library>
  <book>
    <title>1984</title>
    <author>George Orwell</author>
  </book>
  <magazine>
    <title>Time</title>
  </magazine>
</library>
After (Specified: book, author):
[
  {"title":"1984","author":"George Orwell"}
]
Convert spaces after punctuation into nothing
Convert date format into short form

Your email address will not be published. Required fields are marked *