DataFmt

XML to JSON

Parse XML into structured JSON that frontends and scripts can use directly.

Drag & drop a file here, or click to upload
Options:

About this tool

XML documents often need to be reshaped into JSON before a web application can consume them. With fast-xml-parser we provide a robust, configurable translation that handles attributes, text nodes and CDATA sections.

Attributes are placed under a configurable prefix (default `@_`) to avoid clashing with child-element keys, and text nodes are represented as `#text` fields so semantics are preserved in JSON.

How to use

  1. Paste XML text or upload an .xml file.
  2. Tune the attribute prefix or whether to keep text nodes.
  3. Click "Convert" to get JSON.
  4. Toggle pretty-print as needed.

Use cases

Notes

Frequently Asked Questions

Are XML-declared encodings honoured?
The browser normally reads files as UTF-8. For non-UTF-8 files, re-save as UTF-8 first.
Can attributes and child elements share a name?
Yes. Attributes are isolated by their prefix so there is no collision.
How are namespaces handled?
They are kept as part of the key by default. Strip them in pre-processing if you want to ignore namespaces.