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
- Paste XML text or upload an .xml file.
- Tune the attribute prefix or whether to keep text nodes.
- Click "Convert" to get JSON.
- Toggle pretty-print as needed.
Use cases
- Digest legacy XML exports for use in a modern frontend.
- Parse RSS and Atom feeds for display on a web page.
- Inspect SOAP responses field by field.
Notes
- CDATA content is preserved as-is and not re-parsed.
- Namespace prefixes remain part of the resulting keys.
- The attribute prefix is customisable and can be disabled.
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.