XML to JSON Converter
Move data out of a SOAP response, an RSS feed, a config file or a legacy system export and into the JSON your JavaScript, Python or no-code tool reads natively, without hand-writing a parser.
Data Converter
or drop CSV, TSV, TXT … files here ·
Max 95 MB per file· Up to 20 files· Deleted after 30 minutes
Files are processed on our servers and deleted after 30 minutes.
Character that separates columns in CSV and text files, for both reading and writing. Auto detects it from the input and writes commas.
UTF-8 works for every language. Choose UTF-8 with BOM if Excel on Windows shows garbled accents or Asian characters when opening the CSV.
Excel, ODS and Numbers input: convert the first sheet only, or every sheet (one CSV per sheet in a ZIP, or one JSON key per sheet).
Name of the sheet tab in the new spreadsheet, up to 31 characters.
Array of objects uses column names as keys for every row; array of arrays is more compact and keeps the header as the first array.
Name of the outer element that wraps all rows; each row becomes a <row> inside it.
Used in CREATE TABLE and INSERT statements. Letters, digits and underscores only.
Quoting and column types differ slightly between databases; pick the one you will import into.
Rewrite date cells in one format. ISO (2026-10-18) is safest for databases and code; keep leaves them as they appear in the source.
How to use this tool
- 1
Upload the XML
Drop .xml files on the upload area, up to 20 per batch and 95 MB each. Each file is converted on its own.
- 2
Choose readable or compact
Pretty print is on, which indents the JSON for reading and code review. Turn it off under Advanced settings to get the smallest single-line output for an API payload.
- 3
Convert and use the JSON
Press Convert to JSON, download the .json file and load it in your code or tool.
Upload the XML and press Convert to JSON: elements become keys, repeated elements become arrays, and attributes are kept as @-prefixed keys, so no information in the tags is lost.
Who needs an XML to JSON converter
XML 1.0 became a W3C Recommendation in February 1998, and for the next decade it was how systems talked: SOAP web services, RSS and Atom feeds, Office documents, banking messages, product catalogs. Many of those systems are still running. JSON, specified in RFC 8259, took over new web APIs because JavaScript reads it without a parser library and because it maps directly onto lists and dictionaries in almost every language.
So the people converting are usually bridging the two eras. A front-end developer receives a SOAP response from a payment or shipping provider and wants a plain object. An automation builder in Zapier or Make pulls a supplier's XML feed into a flow that works best with JSON. A data engineer migrates config files from an old Java application, or a student needs an RSS feed as JSON for a class project. Each wants the same structure without the angle brackets.
Convert XML to JSON: how tags, attributes and text map
<order id="A-77"> <customer>Lena Ortiz</customer> <total currency="EUR">59.90</total> <item sku="0042">Desk lamp</item> <item sku="0108">LED bulb</item> </order>
| XML construct | Example | JSON result |
|---|---|---|
| Root element | <order> | Top-level key order |
| Attribute | id="A-77" | "@id": "A-77" |
| Element with text only | <customer> | "customer": "Lena Ortiz" |
| Text plus attribute | <total currency="EUR"> | {"@currency": "EUR", "#text": "59.90"} |
| Repeated element | two <item> tags | "item": [ … , … ] array |
| Comment | <!-- note --> | Dropped; JSON has no comments |
XML
Extensible Markup Language
XML is a markup language for structured data published by the W3C in 1998. It uses nested tags with attributes and supports schemas, namespaces and validation, which makes it robust for complex documents. It underlies RSS feeds, SVG, Office documents, sitemaps and many enterprise and government data exchanges. XML is verbose compared with JSON, but every programming language and many spreadsheet tools can read it.
- Compression
- –
- Transparency
- –
- Animation
- –
- Introduced
- 1998 · W3C
JSON
JavaScript Object Notation
JSON is a lightweight text format for structured data, popularised by Douglas Crockford in the early 2000s and standardised as RFC 8259 and ECMA-404. It represents objects, arrays, strings, numbers, booleans and null with simple, readable syntax. It is the default format for web APIs, configuration files and data exchange between apps in almost every programming language. It has no comments, dates or schemas built in, and large nested files are hard to read without a viewer.
- Compression
- –
- Transparency
- –
- Animation
- –
- Introduced
- 2001 · Douglas Crockford
XML goes to JSON when data from an older or enterprise system has to reach a web app, a script or an automation tool: JSON parses natively in JavaScript and maps directly onto Python dictionaries.
XML features that JSON has no place for
Both formats describe trees, but XML carries extras JSON never had. Namespaces, defined by the W3C in 1999, let one document mix vocabularies such as soap: and xsi:; in JSON they survive only as part of key names. Comments and processing instructions have nowhere to go and are dropped. Mixed content, meaning text interleaved with child tags as in an XHTML paragraph with a bold word in it, is valid XML but turns awkward in JSON, so document-style XML is better converted to HTML or Markdown than to JSON.
Order is the subtle one. XML keeps sibling elements in sequence, and a schema may rely on it; a JSON object's keys are, by the standard, unordered. Repeated elements keep their order inside their array, which covers most real data. If the XML is a flat list of records that should end up in a spreadsheet rather than in code, XML to Excel gives you rows and columns directly, and XML to CSV produces a file for a database import.
XML to JSON converter questions
Why is one element an array in one file and an object in another?
A converter only sees what is in the document. If an order has three item tags, items become an array; if it has one, there is nothing to repeat, so it becomes a single object. Code that reads the JSON should accept both shapes, or wrap a single object in an array before looping.
How are XML attributes written in the JSON?
Each attribute becomes a key with an @ in front of its name, so currency="EUR" turns into "@currency": "EUR". When an element has both attributes and text, the text goes into a #text key next to them. This convention keeps attributes and child elements from colliding when they share a name.
Are numbers in the XML turned into JSON numbers?
XML has no data types of its own; 42 and "42" look the same in a tag. Values therefore come out as strings, which keeps ZIP codes and IDs like 007 safe. Convert the fields your code needs to numbers after parsing.
What happens to namespace prefixes such as soap:Envelope?
The prefix stays part of the key name, so the envelope appears as soap:Envelope and the namespace declaration as an @xmlns:soap key. That keeps elements from different vocabularies apart; strip the prefixes in your code if you only work with one.
Can I convert the JSON back to XML afterwards?
Yes, with JSON to XML. Following the same @ and #text convention, attributes return as attributes. Comments and the original indentation do not come back, since the JSON never held them.
- JSON to XML ConverterConvert JSON to XML online: keys become elements, arrays become repeated elements, all inside a root tag you name. Pretty-printed output, no account.
- XML to CSV ConverterConvert XML feeds, invoices and system exports to CSV online. Repeating records become rows, child tags become columns. Up to 20 files, 95 MB each.
- XML to Excel ConverterOpen XML invoices, bank statements, product feeds and system exports as an Excel XLSX table. No XML map or Developer tab needed; works for Mac users too.
- YAML to JSON ConverterConvert .yaml and .yml files to JSON for APIs, validators and tools that only parse JSON. Pretty-printed by default, batches of 20, files deleted in 30 min.
- HTML to JSON ConverterConvert an HTML table to JSON: header cells become keys, each table row becomes an object. Upload saved .html or .htm pages, no scraper code needed.
- JSON to YAML ConverterConvert JSON to YAML online for Kubernetes, GitHub Actions, Compose and Ansible files. Indented, quote-safe output, 20 files per batch, no account needed.