JSON to XML Converter
Drop a JSON file, get well-formed XML with a proper declaration — ready for SOAP, legacy configs, or any XML-only pipeline.
Drop your JSON file here
Converts to .xml — stays on your device
Why convert JSON to XML?
- Feeding JSON data into a SOAP endpoint that only accepts XML envelopes.
- Generating an XML payload for a legacy Java or .NET service from a modern JSON source.
- Producing sample XML fixtures for unit tests in a legacy codebase.
- Creating RSS or Atom feed entries programmatically from JSON records.
- Converting JSON config to XML for a Maven, Ant, or Spring-based build pipeline.
- Generating Office Open XML fragments (custom docx parts) from structured JSON input.
How our converter works
Your JSON is parsed and emitted as XML via fast-xml-parser's builder. Object keys become tag names. Keys prefixed with `@_` become attributes on the parent tag (the reverse of the xml-to-json convention). Arrays become repeated sibling tags. A standard `<?xml version="1.0" encoding="UTF-8"?>` declaration is prepended if absent. The output is pretty-printed with 2-space indentation — readable in any editor or SOAP tester. Runs entirely in your browser; JSON with credentials or internal data never leaves your device.
JSON vs XML — tradeoffs when producing XML
| Feature | JSON | XML |
|---|---|---|
| Attributes | Keys prefixed with `@_` | First-class on the parent tag |
| Arrays | Native `[...]` | Repeated sibling tags |
| Root element | Implicit (usually object) | Required — single top-level tag |
| Verbosity | Compact | Verbose — opening + closing tags |
| Schema validation | JSON Schema | XSD, DTD — more widely deployed |
Frequently asked questions
How do I control which JSON fields become XML attributes?
Prefix the key with `@_` in your JSON. `{"user": {"@_id": 42, "#text": "Alice"}}` becomes `<user id="42">Alice</user>`. This convention mirrors what the XML-to-JSON converter produces, so round-trips are clean.
What happens with JSON arrays?
An array under key `item` produces multiple `<item>` sibling tags — the standard way XML represents repetition. For example `{"items": {"item": [1, 2, 3]}}` becomes `<items><item>1</item><item>2</item><item>3</item></items>`.
Does the output include an XML declaration?
Yes — `<?xml version="1.0" encoding="UTF-8"?>` is always prepended. If you need a different encoding or standalone="yes", hand-edit the first line.
What about namespaces?
Include the `xmlns` attribute as a `@_xmlns` key in your JSON (e.g. `{"@_xmlns": "http://example.com/ns"}`) and it'll render on the tag correctly. Namespaced element names (`ns:tag`) work by using the prefix directly in the JSON key.
Are my files uploaded?
No. The conversion is entirely client-side. JSON containing credentials, PII, or internal configs stays on your device.
About the JSON format
XML is the heavyweight structured-data format that dominated the 2000s: SOAP web services, Java/.NET configs, RSS/Atom feeds, Office Open XML, Android manifests, Ant/Maven builds. JSON won the 2010s and after, but XML hasn't gone anywhere — huge parts of the enterprise stack, government integrations, and publishing pipelines still require it. Converting JSON to XML is what you do at the boundary between a modern service and a legacy consumer: a SOAP endpoint that won't take JSON, a third-party feed generator that expects RSS, an XSD-validated pipeline. The conversion is straightforward for flat objects; the interesting cases are attributes (handled via the `@_` prefix) and repeated elements (handled via JSON arrays). The output is well-formed XML with a proper declaration and pretty-print indentation.