FreeOnlineTool

XML to JSON Convertitore

XML to JSON Convertitore gratuito online. Strumento sviluppatore istantaneo nel browser. Senza registrazione.

XML to JSON converter

Turn SOAP, feed, or config XML into JSON in this tab. Repeated sibling tags become arrays. Attributes stay as @keys or a $ object. Multi-document <?xml streams and multi-root fragments are kept. Nothing is uploaded.

Drop an XML file or paste with ⌘V / Ctrl+V.

⌘V / Ctrl+V · .xml .svg .txt

Attributes
Namespaces
JSON

Come usare

How it works

People search XML to JSON converter when a SOAP envelope, RSS/Atom feed, Android resource file, or vendor config has to become an object they can feed to jq, a REST body, or a spreadsheet. Most sites upload the file. This page does the conversion in the tab.

  1. Paste or drop.xml, .svg, or .txt. Nothing is uploaded.
  2. Repeated tags become arrays — two <book> siblings under <catalog> become "book": [ … ], not a last-write-wins object. That is the usual pain of a naive XML to JSON converter.
  3. Attributes stay visible@ prefix (default) puts @id next to children. $ wrap groups attributes in a $ object (Spark / BadgerFish-adjacent). Ignore drops them when you only need text.
  4. Namespaces — keep soap:Envelope prefixes, or strip them when the consumer only wants local names.
  5. More than one document — concatenated <?xml streams become a JSON array. A multi-root fragment (invalid as a single document) is wrapped so every sibling is kept, with a note.
  6. Pretty or compact — 2-space JSON for reading, one line for a request body. Copy or download converted.json.

This is not an XSD validator and not a SOAP client. The product is an XML to JSON converter that does not send config or customer XML to a third-party server.

Close the tab and the bytes are gone.

FAQ

Why did two <item> tags become an array?

Sibling elements with the same name cannot both be object keys. The converter counts them and emits a JSON array. The result panel shows how many repeated-tag arrays were created.

What do @id and $ mean?

@ prefix is the common xml2js-style mapping: attributes are keys that start with @, text mixed with attributes uses #text. $ wrap puts every attribute on a $ object so child names never collide with attribute names.

Do you upload my XML?

No. DOMParser and JSON.stringify run locally. There is no account. Do not paste secrets into any converter you do not control; this one at least never leaves the tab.

Can I convert JSON back to XML?

Not on this page. The search intent for XML to JSON converter is one direction: XML in, JSON out.

Strumenti correlati