fileexpert

Convert JSON to XML Online — Free

Convert JSON to XML online — useful for legacy APIs, SOAP services, RSS feed publishing, or XML-based ETL pipelines.

Direct converter coming soon

XML output coming. JSON ⇄ CSV is live.

Open JSON to CSV Converter

How to convert JSON to XML

  1. 1

    Add your JSON file

    Drop or select a .json file. Files up to 50MB process locally in your browser — nothing uploaded.

  2. 2

    Run the conversion

    JSON keys become XML element names; values become text content. Nested objects nest inside parent elements; arrays repeat their parent element name. @-prefixed keys convert to XML attributes. A configurable root element name wraps the full structure.

  3. 3

    Download your XML

    One click saves the result as a .xml file. Your original file stays on your device.

Why convert JSON to XML?

If you're integrating with a SOAP service, building an RSS or Atom feed, feeding an XML-based ETL pipeline, generating Android/iOS resource files, producing configuration for a legacy enterprise system, or emitting XML sitemaps from a CMS, you need XML even when your source data lives in JSON. XML is still prevalent in government feeds, healthcare systems (HL7), banking (ISO 20022), and many older B2B workflows.

Common JSON to XML use cases

  • Generating an RSS or Atom feed XML from a JSON content catalog for a news site or podcast distribution
  • Producing SOAP request bodies from JSON payloads when integrating with legacy enterprise APIs (older SAP, Oracle, Microsoft Dynamics)
  • Creating XML sitemaps for SEO from a JSON list of site URLs and metadata
  • Emitting XML config files (Android strings.xml, iOS Localizable.strings-style, Spring Beans XML) from a JSON source of truth

What file size to expect

A JSON array of 50 blog post objects (~12 KB) becomes an RSS feed XML of roughly 14-18 KB — 20-50% larger because XML's verbose open/close tags add overhead. For attribute-heavy output (where many JSON fields map to XML attributes) the XML can be similar or slightly smaller than the JSON.

Technical notes: JSONXML

Conversion follows a reversible convention: string values become text content, number/boolean/null become string representations, nested objects become nested elements, arrays repeat the parent element name, and @-prefixed keys become attributes (e.g., '@id': '5' becomes id='5'). A configurable root element name wraps the full structure (defaults to 'root'). XML special characters (<, >, &, ', ") in values are properly escaped. A #text key on an object indicates mixed content (element has attributes AND text). Optional XML declaration (<?xml version='1.0' encoding='UTF-8'?>) can be prepended.

Compatibility and browser support

Output XML is well-formed and conforms to XML 1.0 spec — parseable by every XML library: DOM/SAX parsers in JavaScript (DOMParser), Python (lxml, xml.etree), Java (JAXP), .NET (System.Xml), PHP (SimpleXML, DOMDocument), and Go (encoding/xml). Validation against a specific XML schema (XSD) is your responsibility downstream.

JSON vs XML

JSONXML
File sizeCompactVerbose
QualityLossless data structureHierarchical with schema support
TransparencyN/AN/A
Browser / app supportAll programming languagesUniversal
Best forAPIs, configs, structured dataDocument markup, legacy APIs, configs

Related conversions

Frequently Asked Questions

Configurable root element?

Yes — pick a root tag name. Default is 'root' but you can use 'rss', 'soapenv:Envelope', 'feed', or anything your target parser expects.

Attribute escaping?

Standard XML escaping is applied — & becomes &amp;, < becomes &lt;, > becomes &gt;, and quote characters in attribute values are escaped.

Attributes vs elements?

Keys prefixed with @ become attributes; all other keys become child elements. Controls the structure of the generated XML precisely.

Array handling?

Arrays of objects repeat the parent element name — {items: [{a: 1}, {a: 2}]} becomes <items><item><a>1</a></item><item><a>2</a></item></items>. Configurable via array-item element name.

Mixed content (text + elements)?

Supported via the #text key — {name: 'foo', '#text': 'prose here', @id: '5'} becomes <name id='5'>prose here</name> with no child elements.

Available?

On the roadmap. Today our JSON ⇄ CSV tool handles tabular data conversion; JSON ⇄ XML is coming soon.