Lintify Logo
Lintify
Converters

JSON to XML Converter

Convert JSON into well-formed XML. Custom root element, configurable array item names, and pretty-printed output for SOAP and legacy systems.

JSON input
1
XML
Output will appear here…

Convert JSON to well-formed XML

XML is older than JSON and is still used everywhere — in SOAP services, in legacy enterprise systems, in Microsoft Office file formats, in RSS feeds, and in many B2B integrations. If you need to send JSON data to a system that only speaks XML, the JSON to XML converter produces a well-formed XML document from any JSON input. The result includes an XML declaration, a configurable root element, and proper escaping of special characters.

Because XML has no native concept of arrays, each element of a JSON array becomes a child element with the singular form of the parent key. The key usersbecomes <users> with multiple<user> children. You can override the item name from the toolbar if your consumer expects a different tag.

How key names are handled

XML element names cannot start with a digit and cannot contain spaces or most punctuation. Lintify sanitizes key names that violate these rules — keys that start with a digit are prefixed with an underscore, and disallowed characters are replaced with underscores. The transformation is deterministic, so the same input always produces the same output.

Null values are omitted

XML has no null literal. The most common convention is to omit the element entirely, which is what Lintify does by default. If your consumer requires an explicit empty element (<field/>), you can post-process the output to replace omitted fields with empty tags. The behavior is consistent with how most JSON-to-XML converters work.

When to use this converter

Use this converter when you have JSON data and need to send it to a system that only accepts XML — typically a legacy SOAP service or a B2B integration partner. For new systems, prefer JSON or Protocol Buffers — XML is verbose, harder to parse, and offers no real advantage over JSON for most use cases. The exception is document-oriented data (HTML, Office documents, scientific publishing) where XML's mixed content model is genuinely useful.

Frequently asked questions

Common questions about the JSON → XML tool.

How are JSON arrays represented in XML?
XML has no native concept of arrays, so each element of a JSON array becomes a child element with a configurable name. By default, Lintify uses the singular form of the parent key (users becomes user). You can override the item name if your consumer expects a different tag.
What happens to JSON keys that start with a number?
XML element names cannot start with a digit, so Lintify prefixes such keys with an underscore. The same applies to keys that contain characters not allowed in XML names (spaces, punctuation). The transformation is deterministic and reversible in practice, although the original key name is lost.
Can I add a namespace or XML declaration?
Yes. The converter includes an XML declaration by default. You can customize the root element name, and if you need namespaces, you can prepend the namespace URI to the root element name and the resulting XML will be well-formed. Full XSD validation is out of scope — use a dedicated XML tool if you need that.
Why are null values dropped?
XML has no null literal. The most common convention is to omit the element entirely, which is what Lintify does by default. If your consumer requires an explicit empty element, you can post-process the output to replace omitted fields with <field/> tags, but that is a consumer-specific convention rather than a standard.
Does the converter handle mixed content?
No. JSON has no equivalent of XML mixed content (text and elements interleaved inside a parent). Lintify produces element-only XML, which is what most modern JSON-to-XML use cases need. If you have a real mixed-content XML requirement, hand-author the XML — converters will not produce what you want.

Related tools