Skip to content
Simple Tools

JSON to XML converter

Write JSON in a declared typed profile or reconstruct elements from an XML tree without guessing types.

Enter data

One JSON document and an explicit XML profile. Fields marked with an asterisk are required.

Up to 50,000 UTF-16 units. Paste an anonymized document, not secrets.

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

  1. Choose the typed profile for JSON data or tree mode for ordinary XML.
  2. Paste JSON; in tree mode every element requires name, attributes and children.
  3. 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

For {"city":"Łódź"}, the typed profile produces <json version="1"><object><member name="city"><string>Łódź</string></member></object></json>. In tree mode, {"name":"p","attributes":{"id":"001"},"children":["Cześć"]} gives <p id="001">Cześć</p>.

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

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.

Read the supporting guide

Generator

JSON Schema validator

Check JSON data against a declared 2020-12 schema profile without network references or data mutation.

Open tool
Generator

Sample JSON generator

Create one deterministic sample from a bounded schema and check it before returning output.

Open tool
Generator

XML to JSON converter

Read the typed profile or ordinary XML as a tree retaining attributes, text and child order.

Open tool