convert

XML to JSON

Convert XML to JSON via fast-xml-parser. Attributes can be preserved (under @_attr keys), numeric / boolean text can be auto-typed, and repeated child elements get wrapped in arrays consistently. Inverse of json-to-xml.

Loading…

About XML to JSON

XML to JSON converts XML documents into JSON using fast-xml-parser, with options to keep attributes (under @_attr keys), auto-type numeric and boolean text, and wrap repeated child elements in arrays consistently. Reach for it when you are pulling data out of SOAP responses, RSS feeds, or legacy XML APIs and want JSON your code can work with. It is the inverse of json-to-xml and runs entirely in your browser.

Category
convert
Input
Accepts: application/xml, text/xml or text/plain.
Output
Outputs: application/json.
Cost
Free, runs in your browser
Memory
low
Privacy: XML to JSON runs entirely on your device. Files you provide never leave your browser — no uploads, no server, no tracking. The page works offline once loaded.

Common uses

  • Turning a SOAP service response into JSON so a modern frontend can consume it
  • Converting an RSS or Atom feed to JSON for a custom reader or aggregator
  • Normalizing a legacy XML config into JSON before migrating it to a new format
  • Preserving element attributes under @_ keys when the attribute data matters
  • Auto-typing numeric and boolean text so '42' and 'true' become real values, not strings
  • Flattening repeated child elements into consistent arrays even when there is only one

Frequently asked questions

What inputs are accepted?

XML as application/xml, text/xml, or plain text. The output is JSON.

What happens to XML attributes?

They can be preserved under @_attr keys so attribute values are not lost in the conversion.

Can it convert text values to numbers and booleans?

Yes. Auto-typing turns numeric and boolean-looking text into real JSON numbers and booleans when enabled.

Does my XML get uploaded?

No. Parsing runs in your browser via fast-xml-parser, so the document stays on your device.

Will repeated elements become arrays?

Yes. Repeated child elements are wrapped in arrays consistently so your code can iterate without special-casing single items.

Keywords

  • xml
  • json
  • convert
  • parse
  • soap
  • rss

Try next