JSON to XML & XML to JSON Converter
Pricing
from $0.001 / document converted
JSON to XML & XML to JSON Converter
Convert JSON to XML or XML to JSON, both ways, with attributes preserved and pretty-printing. Auto-detects the input format. Paste content, pass a list, or fetch from a URL. Great for APIs, SOAP, RSS, config and legacy integrations. Download the result as a file or inline JSON, CSV or Excel.
Pricing
from $0.001 / document converted
Rating
0.0
(0)
Developer
Hipersoft
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
3 hours ago
Last modified
Categories
Features
Share
JSON to XML & XML to JSON Converter — Bulk, Auto-Detect, Attributes Preserved
Convert JSON to XML and XML to JSON in either direction with the JSON / XML Converter. Paste your content, pass a whole list, or fetch it from a URL — the converter auto-detects the format, preserves attributes, and pretty-prints the result. Each conversion is saved as a ready-to-download file and included inline (for small results) in a dataset you can export as JSON, CSV, Excel or XML. It turns one format into the other with zero code — ideal for API and webhook integrations, SOAP and legacy systems, RSS/Atom feeds and config-file conversion.

What is the JSON / XML Converter?
The JSON / XML Converter is a bulk, bidirectional converter between the two most common data-interchange formats. Give it JSON or XML — pasted, as a list, or by URL — and it converts to the other format, auto-detecting the input when you don't specify a direction. It maps XML attributes to JSON keys (and back) using a configurable prefix, lets you set a root element name for arrays, and pretty-prints the output. Instead of writing a parser or pasting documents into a web tool one at a time, you convert a whole batch and wire the output into an automation. It's built for integration engineers bridging JSON and XML systems, and for anyone processing feeds or legacy payloads.
Features
- 🔄 Both directions — JSON → XML and XML → JSON.
- 🧭 Auto-detect — figures out whether your input is JSON or XML and converts the other way.
- 🏷️ Keeps attributes — XML attributes map to JSON keys (and back) using a configurable prefix.
- ✨ Pretty-print — clean, indented output that's easy to read and diff.
- 🌳 Root element control — set the wrapper element name when JSON has no single root (e.g. an array).
- 📚 Batch & URL input — convert one document, a list of documents, or fetch a document from a URL.
- 📎 File + inline output — each result is saved as a downloadable file and (when small) included inline.
- 📤 Clean exports — JSON, CSV, Excel or XML, or wire the output field into the next step of an automation.
Example
XML in
<catalog><book id="1"><title>Node</title><price>29.99</price></book></catalog>
JSON out
{ "catalog": { "book": { "title": "Node", "price": 29.99, "@_id": 1 } } }
What you get

Each document becomes one structured JSON record with a link to the converted file:
{"index": 0,"ok": true,"from": "xml","to": "json","bytesIn": 84,"bytesOut": 72,"fileUrl": "https://api.apify.com/v2/key-value-stores/.../records/converted-0001.json","output": "{ \"catalog\": { \"book\": { \"title\": \"Node\", \"price\": 29.99, \"@_id\": 1 } } }"}
Output schema
| Field | Type | Description |
|---|---|---|
index | integer | Index of the document in the batch. |
ok | boolean | Whether the conversion succeeded. |
from | string | Detected/requested input format. |
to | string | Output format. |
bytesIn | integer | Size of the input. |
bytesOut | integer | Size of the output. |
fileKey | string | Key of the saved file in the run's storage. |
fileUrl | string (URL) | Direct download link to the converted file. |
output | string | Inline converted content (small results only). |
error | string | Reason a conversion failed (on failure rows only). |
How to convert JSON and XML
- Open the JSON / XML Converter and click Try for free.
- Paste your content into
content, add several tocontents, or set acontentUrlto fetch a document. - Choose a
direction(Auto, JSON → XML, or XML → JSON), togglepretty, and setrootName/attributePrefixif needed. - Click Run.
- Download the converted file from
fileUrl, or read the inlineoutputfrom the dataset.
Input
{"content": "<catalog><book id=\"1\"><title>Node</title></book></catalog>","direction": "auto","pretty": true,"attributePrefix": "@_"}
| Field | Type | Description |
|---|---|---|
content | string | The JSON or XML to convert. |
contents | array | Optional list of documents to convert in one run. |
contentUrl | string | Optional URL to a JSON/XML document to fetch. |
direction | string | auto, json2xml, or xml2json. |
pretty | boolean | Indent the output. |
rootName | string | Wrapper name when JSON has no single root. |
attributePrefix | string | JSON keys with this prefix become XML attributes (default @_). |
Use cases
- API integration: bridge a JSON service to an XML/SOAP endpoint, or an XML API to a JSON consumer.
- Feed processing: turn RSS/Atom XML into JSON for downstream steps.
- Config conversion: move between JSON and XML configuration formats in bulk.
- Legacy systems: adapt modern JSON payloads to XML-only backends and vice versa.
- Data migration: normalize a mix of JSON and XML documents into one format.
- Automation glue: drop a conversion step inside an n8n, Make or Zapier workflow.
- Developer tooling: convert payloads at build or runtime as part of a pipeline.
Pricing
Pay-per-event: you're billed a small amount per document converted — you only pay for the results you receive. See the Pricing tab for current rates.
FAQ
How do I convert JSON to XML (or XML to JSON)?
Paste your content and run the actor. With direction on Auto it detects the input format and converts to the other; or pick the exact direction. You get the converted file and inline output.
Are XML attributes preserved?
Yes — attributes convert to JSON keys prefixed with @_ (configurable) and back to attributes on the return trip.
Can I convert many documents at once?
Yes — add a list to contents and each is converted independently, with its own downloadable file.
Can it fetch a document from a URL?
Yes — set contentUrl to a JSON or XML document and the converter downloads and converts it.
What if my JSON is an array with no single root?
Set rootName to the wrapper element name you want, and the converter wraps the array in it when producing XML.
Where does the converted file go?
Each conversion is saved to the run's storage with a direct download link (fileUrl); small results are also included inline as output.
What export formats are supported? The results table exports as JSON, CSV, Excel or XML, and each conversion is a downloadable file, plus programmatic access through the Apify API.
Can I connect this to other apps? The JSON / XML Converter can be connected with almost any cloud service or web app thanks to integrations on the Apify platform. It works with Make, Zapier, Slack, Airbyte, GitHub, Google Drive and many more, plus the Apify API, JavaScript/Python clients and MCP. Or use webhooks to trigger an action whenever a run finishes.
Related Actors
Building a data-format toolkit? Combine the JSON / XML Converter with our other converters:
- YAML ↔ JSON Converter — convert between YAML and JSON.
- CSV to JSON Converter — convert spreadsheets into JSON.
- Excel Converter — convert XLSX to CSV and JSON (and back).
- EML Parser — parse raw emails into structured JSON.
- Case Converter — normalize keys and identifiers between letter cases.
Notes
Original clean-room implementation. Converts the content you provide between JSON and XML.


