JSON to XML & XML to JSON Converter avatar

JSON to XML & XML to JSON Converter

Pricing

from $0.001 / document converted

Go to Apify Store
JSON to XML & XML to JSON Converter

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

Hipersoft

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

3 hours ago

Last modified

Categories

Features

Limited permissions

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.

JSON / XML Converter input — content and direction in the Apify Console

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

JSON / XML Converter output — conversions with file links as a clean dataset

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

FieldTypeDescription
indexintegerIndex of the document in the batch.
okbooleanWhether the conversion succeeded.
fromstringDetected/requested input format.
tostringOutput format.
bytesInintegerSize of the input.
bytesOutintegerSize of the output.
fileKeystringKey of the saved file in the run's storage.
fileUrlstring (URL)Direct download link to the converted file.
outputstringInline converted content (small results only).
errorstringReason a conversion failed (on failure rows only).

How to convert JSON and XML

  1. Open the JSON / XML Converter and click Try for free.
  2. Paste your content into content, add several to contents, or set a contentUrl to fetch a document.
  3. Choose a direction (Auto, JSON → XML, or XML → JSON), toggle pretty, and set rootName / attributePrefix if needed.
  4. Click Run.
  5. Download the converted file from fileUrl, or read the inline output from the dataset.

Input

{
"content": "<catalog><book id=\"1\"><title>Node</title></book></catalog>",
"direction": "auto",
"pretty": true,
"attributePrefix": "@_"
}
FieldTypeDescription
contentstringThe JSON or XML to convert.
contentsarrayOptional list of documents to convert in one run.
contentUrlstringOptional URL to a JSON/XML document to fetch.
directionstringauto, json2xml, or xml2json.
prettybooleanIndent the output.
rootNamestringWrapper name when JSON has no single root.
attributePrefixstringJSON 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.

Building a data-format toolkit? Combine the JSON / XML Converter with our other converters:

Notes

Original clean-room implementation. Converts the content you provide between JSON and XML.