XML to JSON Converter
Parses XML into a JSON object with fast-xml-parser on this page.
About this tool
This page converts the whole document. CSV tools flatten one selected row collection instead.
Mixed content and namespaces may be simplified. This is a structural conversion, not a schema mapping.
How to use it
- Open this page and provide the input it asks for.
- Set the options that are visible, then use Convert.
- Read the result in the panel. Copy it or download it when a file is offered. The input stays in this browser.
Limitations
- Mixed content and namespaces may be simplified. This is a structural conversion, not a schema mapping.
Attributes gain a prefix, and repetition changes the shape
The parser keeps attributes and may number element text
XML is parsed with attributes enabled. Each attribute name is written with the prefix @_ so it cannot be confused with a child element of the same name. Character data that shares an element with attributes or with child elements is placed under #text. A comment is dropped. A CDATA section becomes an ordinary string, and the CDATA wrapper is not represented. The XML declaration is not your document element. With this parser it can appear as a ?xml object holding version and encoding as prefixed attributes, beside the root.
Element text is subject to the parser’s value conversion. A text node that looks like a number can become a JSON number, so a zero-padded code can lose its zeros. Attribute values stay strings. Trimming is on, so space at the ends of text can disappear. Mixed content is the painful case: a sentence with an inline child can come back as a trimmed #text sibling of that child, and the space that separated the words can be gone. You do not get a list of text and tags in document order that you can stitch back without looking.
One child versus two children
A tag that occurs once under its parent is an object. The same tag occurring twice is an array. Adding a second item changes the JSON type, not just the length. Code that expects an object will break when a second sibling appears. The reverse, a one-element array in JSON, is not what a single XML tag produces. This is the central mismatch. Indentation in the XML is not data. The delimiter problem does not arise because XML is not delimited text, but the tree still will not fit a single rectangle without the CSV conversion’s flattener.
Nulls do not exist in the XML
There is no JSON null in the source. An empty element can become an empty string or an empty object depending on attributes and children, and it will not reliably become null. Do not claim the JSON preserves a null that was never there. The CSV-oriented XML parser used by the table tools is a different configuration: it keeps text as text and prefixes attributes with a single @. This page’s JSON uses @. Converting this JSON onward with the JSON-to-XML builder understands that same @ prefix. A detour through CSV will not.
Privacy
Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.

