🌐
JSON Formatter
jsonformatter.org β€Ί json-to-xml
Best JSON to XML Converter
JSON to XML is very unique tool for convert JOSN to XML and allows to download, save, share and print JSON to XML data..
🌐
Code Beautify
codebeautify.org β€Ί jsontoxml
Best JSON to XML Converter to convert JSON to XML String, File, URL
Best Online JSON to XML Converter, Transformer Online Utility. Load form URL, Download, Save and Share.
People also ask

Can I convert large JSON files to XML?
Yes, but very large files may take a few seconds depending on your browser performance.
🌐
lambdatest.com
lambdatest.com β€Ί home β€Ί free tools β€Ί json to xml converter
Free JSON to XML Converter Online Tool | LambdaTest
Is my data secure when I use this converter?
Yes, all conversions happen in your browser. No data is stored or shared.
🌐
lambdatest.com
lambdatest.com β€Ί home β€Ί free tools β€Ί json to xml converter
Free JSON to XML Converter Online Tool | LambdaTest
🌐
CodeShack
codeshack.io β€Ί home β€Ί tools β€Ί json to xml converter
JSON to XML Converter
Convert your JSON text or file into XML format. Fast, free, and simple, all you need to do is enter valid JSON text into the first text box. Copy or download the XML once the JSON is converted.
🌐
Aspose
products.aspose.app β€Ί excel apps β€Ί conversion β€Ί json to xml
Online JSON to XML Converter - Aspose Products
Upload your JSON files to convert. Press the "CONVERT" button. Download the converted XML files instantly or send a download link to email.
🌐
Convertjson
convertjson.com β€Ί json-to-xml.htm
JSON To XML Converter
Use this tool to convert JSON into XML format. New- Now supports JSONLines. Enter your JSON or JSONLines data below and Press the Convert button. The output will display below the Convert button.
🌐
LambdaTest
lambdatest.com β€Ί home β€Ί free tools β€Ί json to xml converter
Free JSON to XML Converter Online Tool | LambdaTest
Free JSON to XML Converter online. Instantly convert JSON to XML format with our secure, browser-based tool. Try our JSON to XML Online Converter today!
Find elsewhere
🌐
JSON Formatter
jsonformatter.org β€Ί xml-to-json
Best XML to JSON Converter Online
XML to JSON is very unique tool for convert JOSN to XML and allows to download, save, share and print XML to JSON data..
🌐
FreeFormatter
freeformatter.com β€Ί json-to-xml-converter.html
Free Online JSON to XML Converter - FreeFormatter.com
This free online tool lets you convert a JSON into an XML file and formats the output with your chosen indentation
🌐
Conversion Tools
conversiontools.io β€Ί convert β€Ί json-to-xml
Convert JSON File to XML Online | Change JSON to XML
Change JSON to XML with our tool. βœ… Upload Large Files. βœ… Zapier automation available. βœ… All Files are Encrypted. βœ… Available Pricing. βœ… 24/7 support. βœ… Try it Now β†’
🌐
Binaryfortress
binaryfortress.com β€Ί JsonToXml
JSON to XML Converter β€’ Binary Fortress Software
At Binary Fortress our goal is to make apps that make your life easier. From multi-monitor enhancements, to helping you deal with email notifications we have everything you need to streamline your day.
🌐
Microsoft Store
apps.microsoft.com β€Ί detail β€Ί 9p99gd1nsqt6
JSON to XML Transformer - Download and install on Windows | Microsoft Store
JSON to XML Converter, Minifier and Formatter is an easy to use utility that allows you to convert JSON and transform it into XML and also acts as an XML to JSON Converter. Additionally you also have the option to minify and Format(beautify) both your JSON and your XML depending on how it is needed.
🌐
ReqBin
reqbin.com β€Ί json-to-xml
Online JSON to XML Converter
Enter JSON data and click "Convert JSON to XML" to convert JSON strings to XML data online and see the result.
Top answer
1 of 5
12

For a simple solution, I recommend Jackson, as it can transform arbitrarily complex JSON into XML with just a few simple lines of code.

import org.codehaus.jackson.map.ObjectMapper;

import com.fasterxml.jackson.xml.XmlMapper;

public class Foo
{
  public String name;
  public Bar bar;

  public static void main(String[] args) throws Exception
  {
    // JSON input: {"name":"FOO","bar":{"id":42}}
    String jsonInput = "{\"name\":\"FOO\",\"bar\":{\"id\":42}}";

    ObjectMapper jsonMapper = new ObjectMapper();
    Foo foo = jsonMapper.readValue(jsonInput, Foo.class);

    XmlMapper xmlMapper = new XmlMapper();
    System.out.println(xmlMapper.writeValueAsString(foo));
    // <Foo xmlns=""><name>FOO</name><bar><id>42</id></bar></Foo>
  }
}

class Bar
{
  public int id;
}

This demo uses Jackson 1.7.7 (the newer 1.7.8 should also work), Jackson XML Databind 0.5.3 (not yet compatible with Jackson 1.8), and Stax2 3.1.1.

2 of 5
6

Here is an example of how you can do this, generating valid XML. I also use the Jackson library in a Maven project.

Maven setup:

<!-- https://mvnrepository.com/artifact/com.fasterxml/jackson-xml-databind -->
    <dependency>
        <groupId>com.fasterxml</groupId>
        <artifactId>jackson-xml-databind</artifactId>
        <version>0.6.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.8.6</version>
    </dependency>

Here is some Java code that first converts a JSON string to an object and then converts the object with the XMLMapper to XML and also removes any wrong element names. The reason for replacing wrong characters in XML element names is the fact that you can use in JSON element names like $oid with characters not allowed in XML. The Jackson library does not account for that, so I ended up adding some code which removes illegal characters from element names and also the namespace declarations.

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.xml.XmlMapper;

import java.io.IOException;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Converts JSON to XML and makes sure the resulting XML 
 * does not have invalid element names.
 */
public class JsonToXMLConverter {

    private static final Pattern XML_TAG =
            Pattern.compile("(?m)(?s)(?i)(?<first><(/)?)(?<nonXml>.+?)(?<last>(/)?>)");

    private static final Pattern REMOVE_ILLEGAL_CHARS = 
            Pattern.compile("(i?)([^\\s=\"'a-zA-Z0-9._-])|(xmlns=\"[^\"]*\")");

    private ObjectMapper mapper = new ObjectMapper();

    private XmlMapper xmlMapper = new XmlMapper();

    String convertToXml(Object obj) throws IOException {
        final String s = xmlMapper.writeValueAsString(obj);
        return removeIllegalXmlChars(s);
    }

    private String removeIllegalXmlChars(String s) {
        final Matcher matcher = XML_TAG.matcher(s);
        StringBuffer sb = new StringBuffer();
        while(matcher.find()) {
            String elementName = REMOVE_ILLEGAL_CHARS.matcher(matcher.group("nonXml"))
                    .replaceAll("").trim();
            matcher.appendReplacement(sb, "${first}" + elementName + "${last}");
        }
        matcher.appendTail(sb);
        return sb.toString();
    }

    Map<String, Object> convertJson(String json) throws IOException {
        return mapper.readValue(json, new TypeReference<Map<String, Object>>(){});
    }

    public String convertJsonToXml(String json) throws IOException {
        return convertToXml(convertJson(json));
    }
}

Here is a JUnit test for convertJsonToXml:

@Test
void convertJsonToXml() throws IOException, ParserConfigurationException, SAXException {
    try(InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/customer_sample.json")) {
        String json = new Scanner(in).useDelimiter("\\Z").next();
        String xml = converter.convertJsonToXml(json);
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document doc = db.parse(new ByteArrayInputStream(xml.getBytes("UTF-8")));
        Node first = doc.getFirstChild();
        assertNotNull(first);
        assertTrue(first.getChildNodes().getLength() > 0);
    }
}
🌐
Altova
altova.com β€Ί xmlspy-xml-editor β€Ί xml-to-json
XML to JSON Converter | Altova
Learn about tools to convert XML to JSON in MapForce Β· XMLSpy and MapForce are both well-suited for data conversion in different scenarios. Now, you can get both of these tools in the specially-priced Altova MissionKit. When you download the MissionKit, you'll get both XMLSpy AND MapForce ...
🌐
Online XML Tools
onlinexmltools.com β€Ί convert-json-to-xml
Convert JSON to XML - Online XML Tools
Free online JSON to XML converter. Just paste your JSON in the input form below and it will automatically get converted to XML. There are no ads, popups or nonsense, just an awesome JSON to XML transformer. Load JSON, get XML.
🌐
SourceForge
sourceforge.net β€Ί projects β€Ί xml2json-converter
Xml2Json Converter download | SourceForge.net
Xml2Json Converter
Download Xml2Json Converter for free. Simple tool for converting large XML-files to JSON or JSON to XML. Simple converter tool with GUI (written on JavaFX) for converting large XML-files to JSON and JSON to XML with indicating progress and uses small amount of memory for converting. Simple converter tool with GUI (written on JavaFX) for converting large XML-files to JSON and JSON to XML with indicating progress and uses small amount of memory for converting. Β· Starting from 1.2.0 application supports batch converting files from directory by pattern. Β· Uses Java 1.8+ (http://www.oracle.com/tech
Rating: 4 ​
🌐
Oxygen XML
oxygenxml.com β€Ί doc β€Ί ug-editor β€Ί topics β€Ί convert-JSON-to-XML-x-tools.html
JSON to XML Converter
Oxygen XML Editor includes a useful and simple tool for converting JSON files to XML.