XML to JSON converter
Read the typed profile or ordinary XML as a tree retaining attributes, text and child order.
Enter data
One XML 1.0 document and an explicit conversion profile. Fields marked with an asterisk are required.
About this tool
JSON and XML do not have one lossless mapping for every document. Choose explicitly: oblicznik typed profile v1 encodes JSON using object, array, string, number, boolean and null elements, with member names in a member name attribute. The XML tree describes each element as name, attributes and children; it handles ordinary namespace-free XML, including mixed text and attributes. The strings "001" and "true" are not guessed to be numbers or booleans.
How to use the calculator
- Choose the typed profile for JSON data or tree mode for ordinary XML.
- Paste XML 1.0 without DTDs, comments or namespaces.
- Select “Process”, copy output and check the receiving application’s requirements.
Calculation details
Formula and calculation method
Profile v1: <json version="1"> contains one value; object contains member name="key" elements; array retains value order. Number tokens remain textually exact. Tree: name is the element name, attributes is a string map, children is an ordered array of strings and elements.
Worked example
The profile <json version="1"><number>9007199254740993</number></json> produces the exact token 9007199254740993. In tree mode, <p id="001">Cześć</p> gives {"name":"p","attributes":{"id":"001"},"children":["Cześć"]}.
Limitations
- Input and output up to 50,000 UTF-16 units. JSON up to 10,000 values and 32 container levels. XML up to 10,000 nodes and 96 element levels; tree mode up to 32 element levels. These are project limits, not standards.
- XML 1.0 only, with an optional UTF-8 declaration. No DTDs, external entities, comments, processing instructions, namespaces or XSD validation. XML 1.0-forbidden characters, such as NUL in a JSON string, cause an error. Duplicate JSON keys are rejected.
- The typed profile is an explicit project format, not a universal XML mapping or API standard. In tree mode, attributes and text remain strings and child order is retained. CDATA becomes text; entity spelling, the declaration and empty-tag spelling are not reconstructed.
Sources
- W3C XML 1.0 — składnia, znaki i encje
- Saxes — parser XML, zdarzenia i obsługa błędów
- IETF RFC 8259 — JSON syntax and interoperability
Engine version: 1.0.0 · Last reviewed: 2 October 2026
Frequently asked questions
Why are XML tags not named after my JSON members?
The typed profile stores keys as attributes, retaining empty names and keys with spaces. For specific tag names, prepare an XML tree.
Can ordinary XML be read in typed mode?
No. Typed mode requires the declared json version="1" wrapper. Read ordinary XML as a tree; text and attributes will not change type.
Does conversion establish XSD or API validity?
No. The parser checks supported syntax and the profile, not destination-system rules. Large numbers may lose precision later in the destination parser.
Is my data uploaded?
Content and output are not sent to a server or analytics or saved in the URL or form history. Copying is a separate action. Reset cannot remove clipboard copies, printouts or extension data. Use anonymized examples.